Revert "Revert "Hide the splash icon when launching with no view..."
Revert submission 21916962-revert-21447384-no-splash-UILAXIUPKJ
Reason for revert: Retry errorprone target
Reverted changes: /q/submissionid:21916962-revert-21447384-no-splash-UILAXIUPKJ
Flag: production issue. Not hidden behind flag
Bug: 269343536
Test: manual
Change-Id: Ia365f886d39d63472d72afc2033fc67e19109f57
diff --git a/src/com/android/launcher3/LauncherSettings.java b/src/com/android/launcher3/LauncherSettings.java
index cef00d9..6e3e96c 100644
--- a/src/com/android/launcher3/LauncherSettings.java
+++ b/src/com/android/launcher3/LauncherSettings.java
@@ -41,6 +41,10 @@
* An animation using the view's background.
*/
public static final int VIEW_BACKGROUND = 1;
+ /**
+ * The default animation for a given view/item info type, but without the splash icon.
+ */
+ public static final int DEFAULT_NO_ICON = 2;
}
/**
diff --git a/src/com/android/launcher3/views/ActivityContext.java b/src/com/android/launcher3/views/ActivityContext.java
index b6f6223..10f40b7 100644
--- a/src/com/android/launcher3/views/ActivityContext.java
+++ b/src/com/android/launcher3/views/ActivityContext.java
@@ -45,6 +45,7 @@
import android.view.WindowInsetsController;
import android.view.inputmethod.InputMethodManager;
import android.widget.Toast;
+import android.window.SplashScreen;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -320,7 +321,14 @@
return false;
}
- Bundle optsBundle = (v != null) ? getActivityLaunchOptions(v, item).toBundle() : null;
+ Bundle optsBundle = null;
+ if (v != null) {
+ optsBundle = getActivityLaunchOptions(v, item).toBundle();
+ } else if (item != null && item.animationType == LauncherSettings.Animation.DEFAULT_NO_ICON
+ && Utilities.ATLEAST_T) {
+ optsBundle = ActivityOptions.makeBasic()
+ .setSplashScreenStyle(SplashScreen.SPLASH_SCREEN_STYLE_SOLID_COLOR).toBundle();
+ }
UserHandle user = item == null ? null : item.user;
// Prepare intent