Loading packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +6 −1 Original line number Original line Diff line number Diff line Loading @@ -206,7 +206,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, @VisibleForTesting @VisibleForTesting protected final ArrayList<Action> mOverflowItems = new ArrayList<>(); protected final ArrayList<Action> mOverflowItems = new ArrayList<>(); private ActionsDialog mDialog; @VisibleForTesting protected ActionsDialog mDialog; private Action mSilentModeAction; private Action mSilentModeAction; private ToggleAction mAirplaneModeOn; private ToggleAction mAirplaneModeOn; Loading Loading @@ -246,6 +247,9 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, @UiEvent(doc = "The global actions / power menu surface became visible on the screen.") @UiEvent(doc = "The global actions / power menu surface became visible on the screen.") GA_POWER_MENU_OPEN(337), GA_POWER_MENU_OPEN(337), @UiEvent(doc = "The global actions / power menu surface was dismissed.") GA_POWER_MENU_CLOSE(471), @UiEvent(doc = "The global actions bugreport button was pressed.") @UiEvent(doc = "The global actions bugreport button was pressed.") GA_BUGREPORT_PRESS(344), GA_BUGREPORT_PRESS(344), Loading Loading @@ -1167,6 +1171,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, if (mDialog == dialog) { if (mDialog == dialog) { mDialog = null; mDialog = null; } } mUiEventLogger.log(GlobalActionsEvent.GA_POWER_MENU_CLOSE); mWindowManagerFuncs.onGlobalActionsHidden(); mWindowManagerFuncs.onGlobalActionsHidden(); mLifecycle.setCurrentState(Lifecycle.State.DESTROYED); mLifecycle.setCurrentState(Lifecycle.State.DESTROYED); } } Loading packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogTest.java +8 −1 Original line number Original line Diff line number Diff line Loading @@ -156,12 +156,19 @@ public class GlobalActionsDialogTest extends SysuiTestCase { } } @Test @Test public void testShouldLogVisibility() { public void testShouldLogShow() { mGlobalActionsDialog.onShow(null); mGlobalActionsDialog.onShow(null); mTestableLooper.processAllMessages(); mTestableLooper.processAllMessages(); verifyLogPosted(GlobalActionsDialog.GlobalActionsEvent.GA_POWER_MENU_OPEN); verifyLogPosted(GlobalActionsDialog.GlobalActionsEvent.GA_POWER_MENU_OPEN); } } @Test public void testShouldLogDismiss() { mGlobalActionsDialog.onDismiss(mGlobalActionsDialog.mDialog); mTestableLooper.processAllMessages(); verifyLogPosted(GlobalActionsDialog.GlobalActionsEvent.GA_POWER_MENU_CLOSE); } @Test @Test public void testShouldLogBugreportPress() throws InterruptedException { public void testShouldLogBugreportPress() throws InterruptedException { GlobalActionsDialog.BugReportAction bugReportAction = GlobalActionsDialog.BugReportAction bugReportAction = Loading Loading
packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +6 −1 Original line number Original line Diff line number Diff line Loading @@ -206,7 +206,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, @VisibleForTesting @VisibleForTesting protected final ArrayList<Action> mOverflowItems = new ArrayList<>(); protected final ArrayList<Action> mOverflowItems = new ArrayList<>(); private ActionsDialog mDialog; @VisibleForTesting protected ActionsDialog mDialog; private Action mSilentModeAction; private Action mSilentModeAction; private ToggleAction mAirplaneModeOn; private ToggleAction mAirplaneModeOn; Loading Loading @@ -246,6 +247,9 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, @UiEvent(doc = "The global actions / power menu surface became visible on the screen.") @UiEvent(doc = "The global actions / power menu surface became visible on the screen.") GA_POWER_MENU_OPEN(337), GA_POWER_MENU_OPEN(337), @UiEvent(doc = "The global actions / power menu surface was dismissed.") GA_POWER_MENU_CLOSE(471), @UiEvent(doc = "The global actions bugreport button was pressed.") @UiEvent(doc = "The global actions bugreport button was pressed.") GA_BUGREPORT_PRESS(344), GA_BUGREPORT_PRESS(344), Loading Loading @@ -1167,6 +1171,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, if (mDialog == dialog) { if (mDialog == dialog) { mDialog = null; mDialog = null; } } mUiEventLogger.log(GlobalActionsEvent.GA_POWER_MENU_CLOSE); mWindowManagerFuncs.onGlobalActionsHidden(); mWindowManagerFuncs.onGlobalActionsHidden(); mLifecycle.setCurrentState(Lifecycle.State.DESTROYED); mLifecycle.setCurrentState(Lifecycle.State.DESTROYED); } } Loading
packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogTest.java +8 −1 Original line number Original line Diff line number Diff line Loading @@ -156,12 +156,19 @@ public class GlobalActionsDialogTest extends SysuiTestCase { } } @Test @Test public void testShouldLogVisibility() { public void testShouldLogShow() { mGlobalActionsDialog.onShow(null); mGlobalActionsDialog.onShow(null); mTestableLooper.processAllMessages(); mTestableLooper.processAllMessages(); verifyLogPosted(GlobalActionsDialog.GlobalActionsEvent.GA_POWER_MENU_OPEN); verifyLogPosted(GlobalActionsDialog.GlobalActionsEvent.GA_POWER_MENU_OPEN); } } @Test public void testShouldLogDismiss() { mGlobalActionsDialog.onDismiss(mGlobalActionsDialog.mDialog); mTestableLooper.processAllMessages(); verifyLogPosted(GlobalActionsDialog.GlobalActionsEvent.GA_POWER_MENU_CLOSE); } @Test @Test public void testShouldLogBugreportPress() throws InterruptedException { public void testShouldLogBugreportPress() throws InterruptedException { GlobalActionsDialog.BugReportAction bugReportAction = GlobalActionsDialog.BugReportAction bugReportAction = Loading