From 0e338eeb1f51a3168b6c7b6a8f512b10df3ae1a6 Mon Sep 17 00:00:00 2001 From: Alison Cichowlas Date: Mon, 8 May 2023 20:52:20 -0400 Subject: [PATCH 1/2] Id for text2 is defined in ids.xml already. Test: still builds; atest ShutdownUiTest Bug: 267722480 Merged-In: I8f50cf85fb46fdc8d661d2f60f1af55df71036fc Change-Id: I8f50cf85fb46fdc8d661d2f60f1af55df71036fc --- core/res/res/layout/shutdown_dialog.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/res/res/layout/shutdown_dialog.xml b/core/res/res/layout/shutdown_dialog.xml index ec67aa86bcc9d..726c25540e6f4 100644 --- a/core/res/res/layout/shutdown_dialog.xml +++ b/core/res/res/layout/shutdown_dialog.xml @@ -40,7 +40,7 @@ android:fontFamily="@string/config_headlineFontFamily"/> Date: Mon, 8 May 2023 20:53:00 -0400 Subject: [PATCH 2/2] SysUIG override for ShutdownUI. Extract layout choice to separate method; include generic ShutdownUi specifically in non-SysUIG versons rather than in all SysUIs. Bug: 267722480 Test: builds; no user visible changes in shutdown flow Merged-In: Iab225a5b733a78c6e0f8f5395f1516fe765994e2 Change-Id: Iab225a5b733a78c6e0f8f5395f1516fe765994e2 --- .../android/systemui/dagger/ReferenceSysUIComponent.java | 2 ++ .../android/systemui/dagger/ReferenceSystemUIModule.java | 4 ++-- .../src/com/android/systemui/dagger/SystemUIModule.java | 2 -- .../com/android/systemui/globalactions/ShutdownUi.java | 6 +++++- .../src/com/android/systemui/tv/TvSysUIComponent.java | 8 ++++---- .../src/com/android/systemui/tv/TvSystemUIModule.java | 4 ++-- .../android/systemui/globalactions/ShutdownUiTest.java | 4 +--- 7 files changed, 16 insertions(+), 14 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSysUIComponent.java b/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSysUIComponent.java index a431a59fcef6e..a90980fddfb0e 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSysUIComponent.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSysUIComponent.java @@ -16,6 +16,7 @@ package com.android.systemui.dagger; +import com.android.systemui.globalactions.ShutdownUiModule; import com.android.systemui.keyguard.CustomizationProvider; import com.android.systemui.statusbar.NotificationInsetsModule; import com.android.systemui.statusbar.QsFrameTranslateModule; @@ -31,6 +32,7 @@ import dagger.Subcomponent; DependencyProvider.class, NotificationInsetsModule.class, QsFrameTranslateModule.class, + ShutdownUiModule.class, SystemUIBinder.class, SystemUIModule.class, SystemUICoreStartableModule.class, diff --git a/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java index d5a41460c89ed..e6ce10a9a7a64 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java @@ -74,12 +74,12 @@ import com.android.systemui.statusbar.policy.SensorPrivacyController; import com.android.systemui.statusbar.policy.SensorPrivacyControllerImpl; import com.android.systemui.volume.dagger.VolumeModule; -import javax.inject.Named; - import dagger.Binds; import dagger.Module; import dagger.Provides; +import javax.inject.Named; + /** * A dagger module for injecting default implementations of components of System UI. * diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java index c7d6517f60bbe..17cf8084df1f1 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java @@ -50,7 +50,6 @@ import com.android.systemui.dreams.dagger.DreamModule; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FeatureFlags; import com.android.systemui.flags.FlagsModule; -import com.android.systemui.globalactions.ShutdownUiModule; import com.android.systemui.keyboard.KeyboardModule; import com.android.systemui.keyguard.data.BouncerViewModule; import com.android.systemui.log.dagger.LogModule; @@ -188,7 +187,6 @@ import javax.inject.Named; ScreenRecordModule.class, SettingsUtilModule.class, ShadeModule.class, - ShutdownUiModule.class, SmartRepliesInflationModule.class, SmartspaceModule.class, StatusBarPipelineModule.class, diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/ShutdownUi.java b/packages/SystemUI/src/com/android/systemui/globalactions/ShutdownUi.java index bc9e1cc559944..8125d70a6ab30 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/ShutdownUi.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/ShutdownUi.java @@ -98,7 +98,7 @@ public class ShutdownUi { window.setBackgroundDrawable(background); window.setWindowAnimations(com.android.systemui.R.style.Animation_ShutdownUi); - d.setContentView(R.layout.shutdown_dialog); + d.setContentView(getShutdownDialogContent()); d.setCancelable(false); int color; @@ -129,6 +129,10 @@ public class ShutdownUi { d.show(); } + public int getShutdownDialogContent() { + return R.layout.shutdown_dialog; + } + @StringRes @VisibleForTesting int getRebootMessage(boolean isReboot, @Nullable String reason) { if (reason != null && reason.startsWith(PowerManager.REBOOT_RECOVERY_UPDATE)) { diff --git a/packages/SystemUI/src/com/android/systemui/tv/TvSysUIComponent.java b/packages/SystemUI/src/com/android/systemui/tv/TvSysUIComponent.java index 640adcc9dd946..5e489b0f38ac8 100644 --- a/packages/SystemUI/src/com/android/systemui/tv/TvSysUIComponent.java +++ b/packages/SystemUI/src/com/android/systemui/tv/TvSysUIComponent.java @@ -20,15 +20,14 @@ import com.android.systemui.dagger.DefaultComponentBinder; import com.android.systemui.dagger.DependencyProvider; import com.android.systemui.dagger.SysUIComponent; import com.android.systemui.dagger.SysUISingleton; -import com.android.systemui.dagger.SystemUIBinder; import com.android.systemui.dagger.SystemUIModule; +import com.android.systemui.globalactions.ShutdownUiModule; +import com.android.systemui.keyguard.dagger.KeyguardModule; +import com.android.systemui.recents.RecentsModule; import com.android.systemui.statusbar.dagger.CentralSurfacesDependenciesModule; import com.android.systemui.statusbar.notification.dagger.NotificationsModule; import com.android.systemui.statusbar.notification.row.NotificationRowModule; -import com.android.systemui.keyguard.dagger.KeyguardModule; -import com.android.systemui.recents.RecentsModule; - import dagger.Subcomponent; /** @@ -43,6 +42,7 @@ import dagger.Subcomponent; NotificationRowModule.class, NotificationsModule.class, RecentsModule.class, + ShutdownUiModule.class, SystemUIModule.class, TvSystemUIBinder.class, TVSystemUICoreStartableModule.class, diff --git a/packages/SystemUI/src/com/android/systemui/tv/TvSystemUIModule.java b/packages/SystemUI/src/com/android/systemui/tv/TvSystemUIModule.java index 0a78d896e1bd3..cbb6ea608ade4 100644 --- a/packages/SystemUI/src/com/android/systemui/tv/TvSystemUIModule.java +++ b/packages/SystemUI/src/com/android/systemui/tv/TvSystemUIModule.java @@ -75,13 +75,13 @@ import com.android.systemui.statusbar.policy.SensorPrivacyControllerImpl; import com.android.systemui.statusbar.tv.notifications.TvNotificationHandler; import com.android.systemui.volume.dagger.VolumeModule; -import javax.inject.Named; - import dagger.Binds; import dagger.Module; import dagger.Provides; import dagger.multibindings.IntoSet; +import javax.inject.Named; + /** * A TV specific version of {@link ReferenceSystemUIModule}. * diff --git a/packages/SystemUI/tests/src/com/android/systemui/globalactions/ShutdownUiTest.java b/packages/SystemUI/tests/src/com/android/systemui/globalactions/ShutdownUiTest.java index e88471909dcbc..9d9b263c5df55 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/globalactions/ShutdownUiTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/globalactions/ShutdownUiTest.java @@ -33,9 +33,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; -/** - * Tests for {@link ListGridLayout}. - */ + @SmallTest @RunWith(AndroidTestingRunner.class) public class ShutdownUiTest extends SysuiTestCase {