diff options
| -rw-r--r-- | services/core/java/com/android/server/utils/AnrTimer.java | 2 | ||||
| -rw-r--r-- | services/tests/servicestests/src/com/android/server/utils/AnrTimerTest.java | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/utils/AnrTimer.java b/services/core/java/com/android/server/utils/AnrTimer.java index 743005a2d844..b7d8cfce34ed 100644 --- a/services/core/java/com/android/server/utils/AnrTimer.java +++ b/services/core/java/com/android/server/utils/AnrTimer.java @@ -767,7 +767,7 @@ public class AnrTimer<V> implements AutoCloseable { * Return true if the native timers are supported. Native timers are supported if the method * nativeAnrTimerSupported() can be executed and it returns true. */ - private static boolean nativeTimersSupported() { + public static boolean nativeTimersSupported() { try { return nativeAnrTimerSupported(); } catch (java.lang.UnsatisfiedLinkError e) { diff --git a/services/tests/servicestests/src/com/android/server/utils/AnrTimerTest.java b/services/tests/servicestests/src/com/android/server/utils/AnrTimerTest.java index c8bef45af839..076d5caf5954 100644 --- a/services/tests/servicestests/src/com/android/server/utils/AnrTimerTest.java +++ b/services/tests/servicestests/src/com/android/server/utils/AnrTimerTest.java @@ -312,10 +312,12 @@ public class AnrTimerTest { } /** - * Verify the dump output. + * Verify the dump output. This only applies when native timers are supported. */ @Test public void testDumpOutput() throws Exception { + if (!AnrTimer.nativeTimersSupported()) return; + String r1 = getDumpOutput(); assertThat(r1).doesNotContain("timer:"); |