Loading packages/SystemUI/multivalentTests/src/com/android/systemui/communal/widgets/WidgetInteractionHandlerTest.kt +2 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ class WidgetInteractionHandlerTest : SysuiTestCase() { /* animationController = */ notNull(), /* fillInIntent = */ refEq(fillInIntent), /* extraOptions = */ refEq(activityOptions.toBundle()), /* customMessage */ isNull(), ) } Loading @@ -93,6 +94,7 @@ class WidgetInteractionHandlerTest : SysuiTestCase() { /* animationController = */ isNull(), /* fillInIntent = */ refEq(fillInIntent), /* extraOptions = */ refEq(activityOptions.toBundle()), /* customMessage */ isNull(), ) } } packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/LegacyActivityStarterInternalImplTest.kt +21 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,25 @@ class LegacyActivityStarterInternalImplTest : SysuiTestCase() { .dismissWithAction(any(), eq(null), anyBoolean(), eq(null)) } @Test fun startPendingIntentDismissingKeyguard_withCustomMessage_dismissWithAction() { val pendingIntent = mock(PendingIntent::class.java) `when`(pendingIntent.isActivity).thenReturn(true) `when`(keyguardStateController.isShowing).thenReturn(true) `when`(deviceProvisionedController.isDeviceProvisioned).thenReturn(true) val customMessage = "Custom unlock reason" underTest.startPendingIntentDismissingKeyguard( intent = pendingIntent, dismissShade = true, customMessage = customMessage ) mainExecutor.runAllReady() verify(statusBarKeyguardViewManager) .dismissWithAction(any(), eq(null), anyBoolean(), eq(customMessage)) } @Test fun startPendingIntentMaybeDismissingKeyguard_keyguardShowing_showOverLs_launchAnimator() { val pendingIntent = mock(PendingIntent::class.java) Loading Loading @@ -466,6 +485,7 @@ class LegacyActivityStarterInternalImplTest : SysuiTestCase() { animationController: ActivityTransitionAnimator.Controller?, fillInIntent: Intent? = null, extraOptions: Bundle? = null, customMessage: String? = null, ) { underTest.startPendingIntentDismissingKeyguard( intent = intent, Loading @@ -475,6 +495,7 @@ class LegacyActivityStarterInternalImplTest : SysuiTestCase() { showOverLockscreen = true, fillInIntent = fillInIntent, extraOptions = extraOptions, customMessage = customMessage, ) } Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/ActivityStarter.java +13 −4 Original line number Diff line number Diff line Loading @@ -84,14 +84,17 @@ public interface ActivityStarter { * Similar to {@link #startPendingIntentMaybeDismissingKeyguard(PendingIntent, Runnable, * ActivityTransitionAnimator.Controller)}, but also specifies a fill-in intent and extra * option that could be used to populate the pending intent and launch the activity. This also * allows the caller to avoid dismissing the shade. * allows the caller to avoid dismissing the shade. An optional custom message can be set as * the unlock reason in the alternate bouncer. */ void startPendingIntentMaybeDismissingKeyguard(PendingIntent intent, boolean dismissShade, @Nullable Runnable intentSentUiThreadCallback, @Nullable ActivityTransitionAnimator.Controller animationController, @Nullable Intent fillInIntent, @Nullable Bundle extraOptions); @Nullable Bundle extraOptions, @Nullable String customMessage ); /** * The intent flag can be specified in startActivity(). Loading Loading @@ -134,14 +137,20 @@ public interface ActivityStarter { void dismissKeyguardThenExecute(OnDismissAction action, @Nullable Runnable cancel, boolean afterKeyguardGone); /** Authenticates if needed and dismisses keyguard to execute an action. */ /** * Authenticates if needed and dismisses keyguard to execute an action. * * TODO(b/348431835) Display the custom message in the new alternate bouncer, when the * device_entry_udfps_refactor flag is enabled. */ void dismissKeyguardThenExecute(OnDismissAction action, @Nullable Runnable cancel, boolean afterKeyguardGone, @Nullable String customMessage); /** Starts an activity and dismisses keyguard. */ void startActivityDismissingKeyguard(Intent intent, boolean onlyProvisioned, boolean dismissShade); boolean dismissShade, @Nullable String customMessage); /** Starts an activity and dismisses keyguard. */ void startActivityDismissingKeyguard(Intent intent, Loading packages/SystemUI/res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -1193,6 +1193,8 @@ <string name="popup_on_dismiss_cta_tile_text">Long press to customize widgets</string> <!-- Text for the button to configure widgets after long press. [CHAR LIMIT=50] --> <string name="button_to_configure_widgets_text">Customize widgets</string> <!-- Text for unlock reason on the bouncer before customizing widgets. [CHAR LIMIT=NONE] --> <string name="unlock_reason_to_customize_widgets">Unlock to customize widgets</string> <!-- Description for the App icon of disabled widget. [CHAR LIMIT=NONE] --> <string name="icon_description_for_disabled_widget">App icon for disabled widget</string> <!-- Description for the App icon of a package that is currently being installed. [CHAR LIMIT=NONE] --> Loading packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivityStarter.kt +2 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import com.android.systemui.communal.widgets.EditWidgetsActivity.Companion.EXTRA import com.android.systemui.communal.widgets.EditWidgetsActivity.Companion.EXTRA_PRESELECTED_KEY import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.plugins.ActivityStarter import com.android.systemui.res.R import javax.inject.Inject interface EditWidgetsActivityStarter { Loading @@ -48,6 +49,7 @@ constructor( }, /* onlyProvisioned = */ true, /* dismissShade = */ true, applicationContext.resources.getString(R.string.unlock_reason_to_customize_widgets), ) } } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/communal/widgets/WidgetInteractionHandlerTest.kt +2 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ class WidgetInteractionHandlerTest : SysuiTestCase() { /* animationController = */ notNull(), /* fillInIntent = */ refEq(fillInIntent), /* extraOptions = */ refEq(activityOptions.toBundle()), /* customMessage */ isNull(), ) } Loading @@ -93,6 +94,7 @@ class WidgetInteractionHandlerTest : SysuiTestCase() { /* animationController = */ isNull(), /* fillInIntent = */ refEq(fillInIntent), /* extraOptions = */ refEq(activityOptions.toBundle()), /* customMessage */ isNull(), ) } }
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/LegacyActivityStarterInternalImplTest.kt +21 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,25 @@ class LegacyActivityStarterInternalImplTest : SysuiTestCase() { .dismissWithAction(any(), eq(null), anyBoolean(), eq(null)) } @Test fun startPendingIntentDismissingKeyguard_withCustomMessage_dismissWithAction() { val pendingIntent = mock(PendingIntent::class.java) `when`(pendingIntent.isActivity).thenReturn(true) `when`(keyguardStateController.isShowing).thenReturn(true) `when`(deviceProvisionedController.isDeviceProvisioned).thenReturn(true) val customMessage = "Custom unlock reason" underTest.startPendingIntentDismissingKeyguard( intent = pendingIntent, dismissShade = true, customMessage = customMessage ) mainExecutor.runAllReady() verify(statusBarKeyguardViewManager) .dismissWithAction(any(), eq(null), anyBoolean(), eq(customMessage)) } @Test fun startPendingIntentMaybeDismissingKeyguard_keyguardShowing_showOverLs_launchAnimator() { val pendingIntent = mock(PendingIntent::class.java) Loading Loading @@ -466,6 +485,7 @@ class LegacyActivityStarterInternalImplTest : SysuiTestCase() { animationController: ActivityTransitionAnimator.Controller?, fillInIntent: Intent? = null, extraOptions: Bundle? = null, customMessage: String? = null, ) { underTest.startPendingIntentDismissingKeyguard( intent = intent, Loading @@ -475,6 +495,7 @@ class LegacyActivityStarterInternalImplTest : SysuiTestCase() { showOverLockscreen = true, fillInIntent = fillInIntent, extraOptions = extraOptions, customMessage = customMessage, ) } Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/ActivityStarter.java +13 −4 Original line number Diff line number Diff line Loading @@ -84,14 +84,17 @@ public interface ActivityStarter { * Similar to {@link #startPendingIntentMaybeDismissingKeyguard(PendingIntent, Runnable, * ActivityTransitionAnimator.Controller)}, but also specifies a fill-in intent and extra * option that could be used to populate the pending intent and launch the activity. This also * allows the caller to avoid dismissing the shade. * allows the caller to avoid dismissing the shade. An optional custom message can be set as * the unlock reason in the alternate bouncer. */ void startPendingIntentMaybeDismissingKeyguard(PendingIntent intent, boolean dismissShade, @Nullable Runnable intentSentUiThreadCallback, @Nullable ActivityTransitionAnimator.Controller animationController, @Nullable Intent fillInIntent, @Nullable Bundle extraOptions); @Nullable Bundle extraOptions, @Nullable String customMessage ); /** * The intent flag can be specified in startActivity(). Loading Loading @@ -134,14 +137,20 @@ public interface ActivityStarter { void dismissKeyguardThenExecute(OnDismissAction action, @Nullable Runnable cancel, boolean afterKeyguardGone); /** Authenticates if needed and dismisses keyguard to execute an action. */ /** * Authenticates if needed and dismisses keyguard to execute an action. * * TODO(b/348431835) Display the custom message in the new alternate bouncer, when the * device_entry_udfps_refactor flag is enabled. */ void dismissKeyguardThenExecute(OnDismissAction action, @Nullable Runnable cancel, boolean afterKeyguardGone, @Nullable String customMessage); /** Starts an activity and dismisses keyguard. */ void startActivityDismissingKeyguard(Intent intent, boolean onlyProvisioned, boolean dismissShade); boolean dismissShade, @Nullable String customMessage); /** Starts an activity and dismisses keyguard. */ void startActivityDismissingKeyguard(Intent intent, Loading
packages/SystemUI/res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -1193,6 +1193,8 @@ <string name="popup_on_dismiss_cta_tile_text">Long press to customize widgets</string> <!-- Text for the button to configure widgets after long press. [CHAR LIMIT=50] --> <string name="button_to_configure_widgets_text">Customize widgets</string> <!-- Text for unlock reason on the bouncer before customizing widgets. [CHAR LIMIT=NONE] --> <string name="unlock_reason_to_customize_widgets">Unlock to customize widgets</string> <!-- Description for the App icon of disabled widget. [CHAR LIMIT=NONE] --> <string name="icon_description_for_disabled_widget">App icon for disabled widget</string> <!-- Description for the App icon of a package that is currently being installed. [CHAR LIMIT=NONE] --> Loading
packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivityStarter.kt +2 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import com.android.systemui.communal.widgets.EditWidgetsActivity.Companion.EXTRA import com.android.systemui.communal.widgets.EditWidgetsActivity.Companion.EXTRA_PRESELECTED_KEY import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.plugins.ActivityStarter import com.android.systemui.res.R import javax.inject.Inject interface EditWidgetsActivityStarter { Loading @@ -48,6 +49,7 @@ constructor( }, /* onlyProvisioned = */ true, /* dismissShade = */ true, applicationContext.resources.getString(R.string.unlock_reason_to_customize_widgets), ) } }