am 9ac663ef: Merge "Disable input dispatch until boot finished." into jb-dev

* commit '9ac663ef9ab6ec455403d1e71bf897c34d3b311e':
  Disable input dispatch until boot finished.
This commit is contained in:
Jeff Brown
2012-05-09 01:48:32 -07:00
committed by Android Git Automerger
5 changed files with 17 additions and 7 deletions

View File

@@ -1017,7 +1017,7 @@ public interface WindowManagerPolicy {
/**
* Called when we have finished booting and can now display the home
* screen to the user. This wilWl happen after systemReady(), and at
* screen to the user. This will happen after systemReady(), and at
* this point the display is active.
*/
public void enableScreenAfterBoot();

View File

@@ -185,7 +185,7 @@ InputDispatcher::InputDispatcher(const sp<InputDispatcherPolicyInterface>& polic
mPolicy(policy),
mPendingEvent(NULL), mAppSwitchSawKeyDown(false), mAppSwitchDueTime(LONG_LONG_MAX),
mNextUnblockedEvent(NULL),
mDispatchEnabled(true), mDispatchFrozen(false), mInputFilterEnabled(false),
mDispatchEnabled(false), mDispatchFrozen(false), mInputFilterEnabled(false),
mInputTargetWaitCause(INPUT_TARGET_WAIT_CAUSE_NONE) {
mLooper = new Looper(false);

View File

@@ -4098,6 +4098,10 @@ public final class ActivityManagerService extends ActivityManagerNative
EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_ENABLE_SCREEN,
SystemClock.uptimeMillis());
mWindowManager.enableScreenAfterBoot();
synchronized (this) {
updateEventDispatchingLocked();
}
}
public void showBootMessage(final CharSequence msg, final boolean always) {
@@ -6686,7 +6690,7 @@ public final class ActivityManagerService extends ActivityManagerNative
synchronized(this) {
mWentToSleep = true;
mWindowManager.setEventDispatching(false);
updateEventDispatchingLocked();
if (!mSleeping) {
mSleeping = true;
@@ -6712,7 +6716,7 @@ public final class ActivityManagerService extends ActivityManagerNative
synchronized(this) {
mShuttingDown = true;
mWindowManager.setEventDispatching(false);
updateEventDispatchingLocked();
if (mMainStack.mResumedActivity != null) {
mMainStack.stopIfSleepingLocked();
@@ -6776,11 +6780,15 @@ public final class ActivityManagerService extends ActivityManagerNative
synchronized(this) {
mWentToSleep = false;
mWindowManager.setEventDispatching(true);
updateEventDispatchingLocked();
comeOutOfSleepIfNeededLocked();
}
}
private void updateEventDispatchingLocked() {
mWindowManager.setEventDispatching(mBooted && !mWentToSleep && !mShuttingDown);
}
public void setLockScreenShown(boolean shown) {
if (checkCallingPermission(android.Manifest.permission.DEVICE_POWER)
!= PackageManager.PERMISSION_GRANTED) {

View File

@@ -41,7 +41,9 @@ final class InputMonitor implements InputManagerService.Callbacks {
private boolean mInputDispatchFrozen;
// When true, input dispatch proceeds normally. Otherwise all events are dropped.
private boolean mInputDispatchEnabled = true;
// Initially false, so that input does not get dispatched until boot is finished at
// which point the ActivityManager will enable dispatching.
private boolean mInputDispatchEnabled;
// When true, need to call updateInputWindowsLw().
private boolean mUpdateInputWindowsNeeded = true;

View File

@@ -5149,7 +5149,7 @@ public class WindowManagerService extends IWindowManager.Stub
//Slog.i(TAG, "******* TELLING SURFACE FLINGER WE ARE BOOTED!");
Parcel data = Parcel.obtain();
data.writeInterfaceToken("android.ui.ISurfaceComposer");
surfaceFlinger.transact(IBinder.FIRST_CALL_TRANSACTION,
surfaceFlinger.transact(IBinder.FIRST_CALL_TRANSACTION, // BOOT_FINISHED
data, null, 0);
data.recycle();
}