From 263a00c73884076189fdf65451f71d112a715eda Mon Sep 17 00:00:00 2001 From: Cyrus Boadway Date: Tue, 22 Jun 2021 09:22:33 +0000 Subject: [PATCH] Suppress Splash Screen on widget reconfiguration activity start When a widget configuration activity is started, it's started from the launcher. Under some circumstances the launcher's splash screen would be shown, rather than the splash screen corresponding to the tapped app. To avoid confusion, we suppress the splash screen for configuration starts. Bug: 190153065 Test: manual Change-Id: Ib18851f1bb50b64bc5d47b8aa5931490c969b54b --- .../android/launcher3/widget/LauncherAppWidgetHost.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/widget/LauncherAppWidgetHost.java b/src/com/android/launcher3/widget/LauncherAppWidgetHost.java index 6dc69712dc..fe83f3f606 100644 --- a/src/com/android/launcher3/widget/LauncherAppWidgetHost.java +++ b/src/com/android/launcher3/widget/LauncherAppWidgetHost.java @@ -60,6 +60,10 @@ public class LauncherAppWidgetHost extends AppWidgetHost { private static final int FLAG_ACTIVITY_RESUMED = 1 << 3; private static final int FLAGS_SHOULD_LISTEN = FLAG_STATE_IS_NORMAL | FLAG_ACTIVITY_STARTED | FLAG_ACTIVITY_RESUMED; + // TODO(b/191735836): Replace with ActivityOptions.KEY_SPLASH_SCREEN_STYLE when un-hidden + private static final String KEY_SPLASH_SCREEN_STYLE = "android.activity.splashScreenStyle"; + // TODO(b/191735836): Replace with SplashScreen.SPLASH_SCREEN_STYLE_EMPTY when un-hidden + private static final int SPLASH_SCREEN_STYLE_EMPTY = 0; public static final int APPWIDGET_HOST_ID = 1024; @@ -329,7 +333,9 @@ public class LauncherAppWidgetHost extends AppWidgetHost { if (view == null) return null; Object tag = view.getTag(); if (!(tag instanceof ItemInfo)) return null; - return activity.getActivityLaunchOptions(view, (ItemInfo) tag).toBundle(); + Bundle bundle = activity.getActivityLaunchOptions(view, (ItemInfo) tag).toBundle(); + bundle.putInt(KEY_SPLASH_SCREEN_STYLE, SPLASH_SCREEN_STYLE_EMPTY); + return bundle; } private void sendActionCancelled(final BaseActivity activity, final int requestCode) {