am d48cf0c0: Merge "Don\'t wait until boot timeout if there is no wallpaper." into jb-dev

* commit 'd48cf0c0ce5f9458802d2be8671c85fa027a74a0':
  Don't wait until boot timeout if there is no wallpaper.
This commit is contained in:
Jeff Brown
2012-06-25 15:28:46 -07:00
committed by Android Git Automerger
2 changed files with 19 additions and 8 deletions

View File

@@ -229,7 +229,7 @@ class ServerThread extends Thread {
Slog.i(TAG, "Window Manager"); Slog.i(TAG, "Window Manager");
wm = WindowManagerService.main(context, power, wm = WindowManagerService.main(context, power,
factoryTest != SystemServer.FACTORY_TEST_LOW_LEVEL, factoryTest != SystemServer.FACTORY_TEST_LOW_LEVEL,
!firstBoot); !firstBoot, onlyCore);
ServiceManager.addService(Context.WINDOW_SERVICE, wm); ServiceManager.addService(Context.WINDOW_SERVICE, wm);
inputManager = wm.getInputManagerService(); inputManager = wm.getInputManagerService();
ServiceManager.addService(Context.INPUT_SERVICE, inputManager); ServiceManager.addService(Context.INPUT_SERVICE, inputManager);

View File

@@ -758,9 +758,15 @@ public class WindowManagerService extends IWindowManager.Stub
// The desired scaling factor for compatible apps. // The desired scaling factor for compatible apps.
float mCompatibleScreenScale; float mCompatibleScreenScale;
// If true, only the core apps and services are being launched because the device
// is in a special boot mode, such as being encrypted or waiting for a decryption password.
// For example, when this flag is true, there will be no wallpaper service.
final boolean mOnlyCore;
public static WindowManagerService main(Context context, public static WindowManagerService main(Context context,
PowerManagerService pm, boolean haveInputMethods, boolean allowBootMsgs) { PowerManagerService pm, boolean haveInputMethods, boolean allowBootMsgs,
WMThread thr = new WMThread(context, pm, haveInputMethods, allowBootMsgs); boolean onlyCore) {
WMThread thr = new WMThread(context, pm, haveInputMethods, allowBootMsgs, onlyCore);
thr.start(); thr.start();
synchronized (thr) { synchronized (thr) {
@@ -781,21 +787,23 @@ public class WindowManagerService extends IWindowManager.Stub
private final PowerManagerService mPM; private final PowerManagerService mPM;
private final boolean mHaveInputMethods; private final boolean mHaveInputMethods;
private final boolean mAllowBootMessages; private final boolean mAllowBootMessages;
private final boolean mOnlyCore;
public WMThread(Context context, PowerManagerService pm, public WMThread(Context context, PowerManagerService pm,
boolean haveInputMethods, boolean allowBootMsgs) { boolean haveInputMethods, boolean allowBootMsgs, boolean onlyCore) {
super("WindowManager"); super("WindowManager");
mContext = context; mContext = context;
mPM = pm; mPM = pm;
mHaveInputMethods = haveInputMethods; mHaveInputMethods = haveInputMethods;
mAllowBootMessages = allowBootMsgs; mAllowBootMessages = allowBootMsgs;
mOnlyCore = onlyCore;
} }
@Override @Override
public void run() { public void run() {
Looper.prepare(); Looper.prepare();
WindowManagerService s = new WindowManagerService(mContext, mPM, WindowManagerService s = new WindowManagerService(mContext, mPM,
mHaveInputMethods, mAllowBootMessages); mHaveInputMethods, mAllowBootMessages, mOnlyCore);
android.os.Process.setThreadPriority( android.os.Process.setThreadPriority(
android.os.Process.THREAD_PRIORITY_DISPLAY); android.os.Process.THREAD_PRIORITY_DISPLAY);
android.os.Process.setCanSelfBackground(false); android.os.Process.setCanSelfBackground(false);
@@ -858,10 +866,11 @@ public class WindowManagerService extends IWindowManager.Stub
} }
private WindowManagerService(Context context, PowerManagerService pm, private WindowManagerService(Context context, PowerManagerService pm,
boolean haveInputMethods, boolean showBootMsgs) { boolean haveInputMethods, boolean showBootMsgs, boolean onlyCore) {
mContext = context; mContext = context;
mHaveInputMethods = haveInputMethods; mHaveInputMethods = haveInputMethods;
mAllowBootMessages = showBootMsgs; mAllowBootMessages = showBootMsgs;
mOnlyCore = onlyCore;
mLimitedAlphaCompositing = context.getResources().getBoolean( mLimitedAlphaCompositing = context.getResources().getBoolean(
com.android.internal.R.bool.config_sf_limitedAlpha); com.android.internal.R.bool.config_sf_limitedAlpha);
mHeadless = "1".equals(SystemProperties.get(SYSTEM_HEADLESS, "0")); mHeadless = "1".equals(SystemProperties.get(SYSTEM_HEADLESS, "0"));
@@ -5191,7 +5200,8 @@ public class WindowManagerService extends IWindowManager.Stub
Slog.i(TAG, "performEnableScreen: mDisplayEnabled=" + mDisplayEnabled Slog.i(TAG, "performEnableScreen: mDisplayEnabled=" + mDisplayEnabled
+ " mForceDisplayEnabled=" + mForceDisplayEnabled + " mForceDisplayEnabled=" + mForceDisplayEnabled
+ " mShowingBootMessages=" + mShowingBootMessages + " mShowingBootMessages=" + mShowingBootMessages
+ " mSystemBooted=" + mSystemBooted, here); + " mSystemBooted=" + mSystemBooted
+ " mOnlyCore=" + mOnlyCore, here);
} }
if (mDisplayEnabled) { if (mDisplayEnabled) {
return; return;
@@ -5209,7 +5219,8 @@ public class WindowManagerService extends IWindowManager.Stub
// wallpaper, don't bother waiting for it // wallpaper, don't bother waiting for it
boolean haveWallpaper = false; boolean haveWallpaper = false;
boolean wallpaperEnabled = mContext.getResources().getBoolean( boolean wallpaperEnabled = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_enableWallpaperService); com.android.internal.R.bool.config_enableWallpaperService)
&& !mOnlyCore;
boolean haveKeyguard = true; boolean haveKeyguard = true;
final int N = mWindows.size(); final int N = mWindows.size();
for (int i=0; i<N; i++) { for (int i=0; i<N; i++) {