Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db80c88f authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Initialise desktop_mode_visible_tasks system property." into main

parents eff7ffab 632b25f9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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"
    }
}
+10 −0
Original line number Diff line number Diff line
@@ -122,6 +122,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))