Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f295e3a8 authored by Luca Zuccarini's avatar Luca Zuccarini
Browse files

Hide the splash icon when launching with no view and no item.

This is achieved by instead creating an empty item info that only
specifies the splash type to be solid color.

Bug: 269343536
Test: manual
Change-Id: Ibf5c8f1c949e26af207b8c6e382f71677b9acc2d
parent 8ca28c4e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -20,10 +20,11 @@ import static android.os.Trace.TRACE_TAG_APP;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_OPTIMIZE_MEASURE;
import static android.view.accessibility.AccessibilityEvent.TYPE_VIEW_FOCUSED;

import static com.android.launcher3.LauncherSettings.Animation.DEFAULT_NO_ICON;
import static com.android.launcher3.LauncherSettings.Animation.VIEW_BACKGROUND;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_SEARCH_ACTION;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT;
import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.NORMAL;
@@ -169,7 +170,6 @@ import com.android.quickstep.views.FloatingTaskView;
import com.android.quickstep.views.OverviewActionsView;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.unfold.RemoteUnfoldSharedComponent;
import com.android.systemui.unfold.UnfoldSharedComponent;
@@ -187,7 +187,6 @@ import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Stream;

@@ -1050,7 +1049,8 @@ public class QuickstepLauncher extends Launcher {
            activityOptions.options.setSourceInfo(ActivityOptions.SourceInfo.TYPE_LAUNCHER,
                    mLastTouchUpTime);
        }
        if (item != null && item.itemType == ITEM_TYPE_SEARCH_ACTION) {
        if (item != null && (item.animationType == DEFAULT_NO_ICON
                || item.animationType == VIEW_BACKGROUND)) {
            activityOptions.options.setSplashScreenStyle(
                    SplashScreen.SPLASH_SCREEN_STYLE_SOLID_COLOR);
        } else {
+4 −0
Original line number Diff line number Diff line
@@ -41,6 +41,10 @@ public class LauncherSettings {
         * 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;
    }

    /**
+9 −1
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import android.view.WindowInsets;
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 @@ public interface ActivityContext {
            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