Merge "[RESTRICT AUTOMERGE]Fix launching app from work profile cannot show splash screen." into rvc-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
7874170373
@@ -2299,9 +2299,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
public StartingSurface addSplashScreen(IBinder appToken, String packageName, int theme,
|
public StartingSurface addSplashScreen(IBinder appToken, int userId, String packageName,
|
||||||
CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes, int icon,
|
int theme, CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes,
|
||||||
int logo, int windowFlags, Configuration overrideConfig, int displayId) {
|
int icon, int logo, int windowFlags, Configuration overrideConfig, int displayId) {
|
||||||
if (!SHOW_SPLASH_SCREENS) {
|
if (!SHOW_SPLASH_SCREENS) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -2328,10 +2328,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
|
|
||||||
if (theme != context.getThemeResId() || labelRes != 0) {
|
if (theme != context.getThemeResId() || labelRes != 0) {
|
||||||
try {
|
try {
|
||||||
context = context.createPackageContext(packageName, CONTEXT_RESTRICTED);
|
context = context.createPackageContextAsUser(packageName, CONTEXT_RESTRICTED,
|
||||||
|
UserHandle.of(userId));
|
||||||
context.setTheme(theme);
|
context.setTheme(theme);
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
// Ignore
|
Slog.w(TAG, "Failed creating package context with package name "
|
||||||
|
+ packageName + " for user " + userId, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -933,9 +933,9 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants {
|
|||||||
* @return The starting surface.
|
* @return The starting surface.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public StartingSurface addSplashScreen(IBinder appToken, String packageName, int theme,
|
public StartingSurface addSplashScreen(IBinder appToken, int userId, String packageName,
|
||||||
CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes, int icon,
|
int theme, CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes,
|
||||||
int logo, int windowFlags, Configuration overrideConfig, int displayId);
|
int icon, int logo, int windowFlags, Configuration overrideConfig, int displayId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set or clear a window which can behave as the keyguard.
|
* Set or clear a window which can behave as the keyguard.
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ class SplashScreenStartingData extends StartingData {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
StartingSurface createStartingSurface(ActivityRecord activity) {
|
StartingSurface createStartingSurface(ActivityRecord activity) {
|
||||||
return mService.mPolicy.addSplashScreen(activity.token, mPkg, mTheme, mCompatInfo,
|
return mService.mPolicy.addSplashScreen(activity.token, activity.mUserId, mPkg, mTheme,
|
||||||
mNonLocalizedLabel, mLabelRes, mIcon, mLogo, mWindowFlags,
|
mCompatInfo, mNonLocalizedLabel, mLabelRes, mIcon, mLogo, mWindowFlags,
|
||||||
mMergedOverrideConfiguration, activity.getDisplayContent().getDisplayId());
|
mMergedOverrideConfiguration, activity.getDisplayContent().getDisplayId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,9 +109,9 @@ class TestWindowManagerPolicy implements WindowManagerPolicy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StartingSurface addSplashScreen(IBinder appToken, String packageName, int theme,
|
public StartingSurface addSplashScreen(IBinder appToken, int userId, String packageName,
|
||||||
CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes, int icon,
|
int theme, CompatibilityInfo compatInfo, CharSequence nonLocalizedLabel, int labelRes,
|
||||||
int logo, int windowFlags, Configuration overrideConfig, int displayId) {
|
int icon, int logo, int windowFlags, Configuration overrideConfig, int displayId) {
|
||||||
final com.android.server.wm.WindowState window;
|
final com.android.server.wm.WindowState window;
|
||||||
final ActivityRecord activity;
|
final ActivityRecord activity;
|
||||||
final WindowManagerService wm = mWmSupplier.get();
|
final WindowManagerService wm = mWmSupplier.get();
|
||||||
|
|||||||
Reference in New Issue
Block a user