From c43d56895fbb332f3f619b7e898c84d55a495d93 Mon Sep 17 00:00:00 2001 From: Junyu Lai Date: Tue, 26 Nov 2024 16:25:20 +0800 Subject: [PATCH] Skip NetworkStatsBinderTest if the binder interface is not accessible. Following up from aosp/3313055, the binder interface getUidStats(II)J is removed from the module. Currently, the test catches NoSuchMethodException for reflection. But did not properly skip for NoSuchMethodError which is thrown by the java runtime when a method was present during compilation is no longer available. Test: cts-tradefed run commandAndExit cts -m CtsNetTestCases -t \ android.net.cts.NetworkStatsBinderTestinderTest Bug: 378982661 Merged-In: I7b8baa7ab98ce0114541bf1a9568db6f832213b6 Change-Id: I7b8baa7ab98ce0114541bf1a9568db6f832213b6 (cherry picked from commit 05b57b77243037c4ee06104c40e24691ceeb6202) --- tests/cts/net/src/android/net/cts/NetworkStatsBinderTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cts/net/src/android/net/cts/NetworkStatsBinderTest.java b/tests/cts/net/src/android/net/cts/NetworkStatsBinderTest.java index 1a48983028..c6c015e57c 100644 --- a/tests/cts/net/src/android/net/cts/NetworkStatsBinderTest.java +++ b/tests/cts/net/src/android/net/cts/NetworkStatsBinderTest.java @@ -134,7 +134,7 @@ public class NetworkStatsBinderTest { } catch (ClassNotFoundException e) { /* not vulnerable if hidden API no longer available */ return; - } catch (NoSuchMethodException e) { + } catch (NoSuchMethodException | NoSuchMethodError e) { /* not vulnerable if hidden API no longer available */ return; } catch (RemoteException e) {