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

Commit cc1e7da8 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Gerrit Code Review
Browse files

Merge "[RESTRICT AUTOMERGE]Fix launching app from work profile cannot show splash screen."

parents 4c73e05c 413456e6
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -2299,9 +2299,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {

    /** {@inheritDoc} */
    @Override
    public StartingSurface addSplashScreen(IBinder appToken, String packageName, int theme,
            CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes, int icon,
            int logo, int windowFlags, Configuration overrideConfig, int displayId) {
    public StartingSurface addSplashScreen(IBinder appToken, int userId, String packageName,
            int theme, CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes,
            int icon, int logo, int windowFlags, Configuration overrideConfig, int displayId) {
        if (!SHOW_SPLASH_SCREENS) {
            return null;
        }
@@ -2328,10 +2328,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {

            if (theme != context.getThemeResId() || labelRes != 0) {
                try {
                    context = context.createPackageContext(packageName, CONTEXT_RESTRICTED);
                    context = context.createPackageContextAsUser(packageName, CONTEXT_RESTRICTED,
                            UserHandle.of(userId));
                    context.setTheme(theme);
                } catch (PackageManager.NameNotFoundException e) {
                    // Ignore
                    Slog.w(TAG,  "Failed creating package context with package name "
                            + packageName + " for user " + userId, e);
                }
            }

+3 −3
Original line number Diff line number Diff line
@@ -933,9 +933,9 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants {
     * @return The starting surface.
     *
     */
    public StartingSurface addSplashScreen(IBinder appToken, String packageName, int theme,
            CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes, int icon,
            int logo, int windowFlags, Configuration overrideConfig, int displayId);
    public StartingSurface addSplashScreen(IBinder appToken, int userId, String packageName,
            int theme, CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes,
            int icon, int logo, int windowFlags, Configuration overrideConfig, int displayId);

    /**
     * Set or clear a window which can behave as the keyguard.
+2 −2
Original line number Diff line number Diff line
@@ -53,8 +53,8 @@ class SplashScreenStartingData extends StartingData {

    @Override
    StartingSurface createStartingSurface(ActivityRecord activity) {
        return mService.mPolicy.addSplashScreen(activity.token, mPkg, mTheme, mCompatInfo,
                mNonLocalizedLabel, mLabelRes, mIcon, mLogo, mWindowFlags,
        return mService.mPolicy.addSplashScreen(activity.token, activity.mUserId, mPkg, mTheme,
                mCompatInfo, mNonLocalizedLabel, mLabelRes, mIcon, mLogo, mWindowFlags,
                mMergedOverrideConfiguration, activity.getDisplayContent().getDisplayId());
    }
}
+3 −3
Original line number Diff line number Diff line
@@ -109,9 +109,9 @@ class TestWindowManagerPolicy implements WindowManagerPolicy {
    }

    @Override
    public StartingSurface addSplashScreen(IBinder appToken, String packageName, int theme,
            CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes, int icon,
            int logo, int windowFlags, Configuration overrideConfig, int displayId) {
    public StartingSurface addSplashScreen(IBinder appToken, int userId, String packageName,
            int theme, CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes,
            int icon, int logo, int windowFlags, Configuration overrideConfig, int displayId) {
        final com.android.server.wm.WindowState window;
        final ActivityRecord activity;
        final WindowManagerService wm = mWmSupplier.get();