summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeLoggerTransitionObserver.kt4
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopModeLoggerTransitionObserverTest.kt10
2 files changed, 14 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeLoggerTransitionObserver.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeLoggerTransitionObserver.kt
index 063747494a82..2b38cdae3c47 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeLoggerTransitionObserver.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeLoggerTransitionObserver.kt
@@ -101,6 +101,9 @@ class DesktopModeLoggerTransitionObserver(
fun onInit() {
transitions.registerObserver(this)
+ SystemProperties.set(
+ VISIBLE_TASKS_COUNTER_SYSTEM_PROPERTY,
+ VISIBLE_TASKS_COUNTER_SYSTEM_PROPERTY_DEFAULT_VALUE)
}
override fun onTransitionReady(
@@ -441,5 +444,6 @@ class DesktopModeLoggerTransitionObserver(
@VisibleForTesting
const val VISIBLE_TASKS_COUNTER_SYSTEM_PROPERTY =
"debug.tracing." + VISIBLE_TASKS_COUNTER_NAME
+ const val VISIBLE_TASKS_COUNTER_SYSTEM_PROPERTY_DEFAULT_VALUE = "0"
}
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopModeLoggerTransitionObserverTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopModeLoggerTransitionObserverTest.kt
index d399b20abb2a..db65ae11fc7e 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopModeLoggerTransitionObserverTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopModeLoggerTransitionObserverTest.kt
@@ -123,6 +123,16 @@ class DesktopModeLoggerTransitionObserverTest : ShellTestCase() {
}
@Test
+ fun testInitialiseVisibleTasksSystemProperty() {
+ ExtendedMockito.verify {
+ SystemProperties.set(
+ eq(DesktopModeLoggerTransitionObserver.VISIBLE_TASKS_COUNTER_SYSTEM_PROPERTY),
+ eq(DesktopModeLoggerTransitionObserver
+ .VISIBLE_TASKS_COUNTER_SYSTEM_PROPERTY_DEFAULT_VALUE))
+ }
+ }
+
+ @Test
fun testRegistersObserverAtInit() {
verify(transitions).registerObserver(same(transitionObserver))
}