am 53cb242f: Merge "Fix issue where keyguard adds widgets before the system is ready" into klp-dev

* commit '53cb242f39c9ccfee3381ff28625e74e365d29b7':
  Fix issue where keyguard adds widgets before the system is ready
This commit is contained in:
Jim Miller
2013-10-17 16:19:31 -07:00
committed by Android Git Automerger
7 changed files with 33 additions and 6 deletions

View File

@ -43,4 +43,5 @@ interface IKeyguardService {
oneway void showAssistant();
oneway void dispatch(in MotionEvent event);
oneway void launchCamera();
oneway void onBootCompleted();
}

View File

@ -141,6 +141,10 @@ public class KeyguardService extends Service {
checkPermission();
mKeyguardViewMediator.launchCamera();
}
public void onBootCompleted() {
checkPermission();
mKeyguardViewMediator.onBootCompleted();
}
};
}

View File

@ -635,15 +635,14 @@ public class KeyguardUpdateMonitor {
* PhoneWindowManager in this case.
*/
protected void dispatchBootCompleted() {
if (!mBootCompleted) {
mHandler.sendEmptyMessage(MSG_BOOT_COMPLETED);
}
mHandler.sendEmptyMessage(MSG_BOOT_COMPLETED);
}
/**
* Handle {@link #MSG_BOOT_COMPLETED}
*/
protected void handleBootCompleted() {
if (mBootCompleted) return;
mBootCompleted = true;
mAudioManager = new AudioManager(mContext);
mAudioManager.registerRemoteControlDisplay(mRemoteControlDisplay);

View File

@ -530,9 +530,6 @@ public class KeyguardViewMediator {
mSystemReady = true;
mUpdateMonitor.registerCallback(mUpdateCallback);
// Send boot completed message if it hasn't already been sent.
mUpdateMonitor.dispatchBootCompleted();
// Suppress biometric unlock right after boot until things have settled if it is the
// selected security method, otherwise unsuppress it. It must be unsuppressed if it is
// not the selected security method for the following reason: if the user starts
@ -1366,4 +1363,8 @@ public class KeyguardViewMediator {
Message msg = mHandler.obtainMessage(LAUNCH_CAMERA);
mHandler.sendMessage(msg);
}
public void onBootCompleted() {
mUpdateMonitor.dispatchBootCompleted();
}
}

View File

@ -4668,6 +4668,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
/** {@inheritDoc} */
public void systemBooted() {
if (mKeyguardDelegate != null) {
mKeyguardDelegate.onBootCompleted();
}
synchronized (mLock) {
mSystemBooted = true;
}

View File

@ -52,6 +52,7 @@ public class KeyguardServiceDelegate {
public int offReason;
public int currentUser;
public boolean screenIsOn;
public boolean bootCompleted;
};
public interface ShowListener {
@ -117,6 +118,9 @@ public class KeyguardServiceDelegate {
// This is used to hide the scrim once keyguard displays.
mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(null));
}
if (mKeyguardState.bootCompleted) {
mKeyguardService.onBootCompleted();
}
}
@Override
@ -305,4 +309,11 @@ public class KeyguardServiceDelegate {
});
}
public void onBootCompleted() {
if (mKeyguardService != null) {
mKeyguardService.onBootCompleted();
}
mKeyguardState.bootCompleted = true;
}
}

View File

@ -180,6 +180,14 @@ public class KeyguardServiceWrapper implements IKeyguardService {
}
}
public void onBootCompleted() {
try {
mService.onBootCompleted();
} catch (RemoteException e) {
Slog.w(TAG , "Remote Exception", e);
}
}
public void showAssistant() {
// Not used by PhoneWindowManager
}