Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +26 −2 Original line number Diff line number Diff line Loading @@ -104,7 +104,6 @@ import com.android.internal.policy.PhoneWindow; import android.view.Surface; import android.view.View; import android.view.ViewConfiguration; import android.view.Window; import android.view.WindowManager; import android.view.WindowManagerGlobal; import android.view.WindowManagerInternal; Loading Loading @@ -359,6 +358,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { boolean mSystemReady; boolean mSystemBooted; private boolean mDeferBindKeyguard; boolean mHdmiPlugged; HdmiControl mHdmiControl; IUiModeManager mUiModeManager; Loading Loading @@ -6012,6 +6012,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { readCameraLensCoverState(); updateUiMode(); boolean bindKeyguardNow; synchronized (mLock) { updateOrientationListenerLp(); mSystemReady = true; Loading @@ -6021,13 +6022,36 @@ public class PhoneWindowManager implements WindowManagerPolicy { updateSettings(); } }); bindKeyguardNow = mDeferBindKeyguard; if (bindKeyguardNow) { // systemBooted ran but wasn't able to bind to the Keyguard, we'll do it now. mDeferBindKeyguard = false; } } if (bindKeyguardNow) { mKeyguardDelegate.bindService(mContext); mKeyguardDelegate.onBootCompleted(); } } /** {@inheritDoc} */ @Override public void systemBooted() { boolean bindKeyguardNow = false; synchronized (mLock) { // Time to bind Keyguard; take care to only bind it once, either here if ready or // in systemReady if not. if (mKeyguardDelegate != null) { bindKeyguardNow = true; } else { // Because mKeyguardDelegate is null, we know that the synchronized block in // systemReady didn't run yet and setting this will actually have an effect. mDeferBindKeyguard = true; } } if (bindKeyguardNow) { mKeyguardDelegate.bindService(mContext); mKeyguardDelegate.onBootCompleted(); } Loading services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java +17 −10 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ public class KeyguardServiceDelegate { private final KeyguardState mKeyguardState = new KeyguardState(); private ShowListener mShowListenerWhenConnect; /* package */ static final class KeyguardState { private static final class KeyguardState { KeyguardState() { // Assume keyguard is showing and secure until we know for sure. This is here in // the event something checks before the service is actually started. Loading Loading @@ -119,8 +119,13 @@ public class KeyguardServiceDelegate { mKeyguardState.showing = false; mKeyguardState.showingAndNotOccluded = false; mKeyguardState.secure = false; synchronized (mKeyguardState) { // TODO: Fix synchronisation model in this class. The other state in this class // is at least self-healing but a race condition here can lead to the scrim being // stuck on keyguard-less devices. mKeyguardState.deviceHasKeyguard = false; hideScrim(); } } else { if (DEBUG) Log.v(TAG, "*** Keyguard started"); } Loading Loading @@ -307,6 +312,7 @@ public class KeyguardServiceDelegate { } public void showScrim() { synchronized (mKeyguardState) { if (!mKeyguardState.deviceHasKeyguard) return; mScrim.post(new Runnable() { @Override Loading @@ -315,6 +321,7 @@ public class KeyguardServiceDelegate { } }); } } public void hideScrim() { mScrim.post(new Runnable() { Loading Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +26 −2 Original line number Diff line number Diff line Loading @@ -104,7 +104,6 @@ import com.android.internal.policy.PhoneWindow; import android.view.Surface; import android.view.View; import android.view.ViewConfiguration; import android.view.Window; import android.view.WindowManager; import android.view.WindowManagerGlobal; import android.view.WindowManagerInternal; Loading Loading @@ -359,6 +358,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { boolean mSystemReady; boolean mSystemBooted; private boolean mDeferBindKeyguard; boolean mHdmiPlugged; HdmiControl mHdmiControl; IUiModeManager mUiModeManager; Loading Loading @@ -6012,6 +6012,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { readCameraLensCoverState(); updateUiMode(); boolean bindKeyguardNow; synchronized (mLock) { updateOrientationListenerLp(); mSystemReady = true; Loading @@ -6021,13 +6022,36 @@ public class PhoneWindowManager implements WindowManagerPolicy { updateSettings(); } }); bindKeyguardNow = mDeferBindKeyguard; if (bindKeyguardNow) { // systemBooted ran but wasn't able to bind to the Keyguard, we'll do it now. mDeferBindKeyguard = false; } } if (bindKeyguardNow) { mKeyguardDelegate.bindService(mContext); mKeyguardDelegate.onBootCompleted(); } } /** {@inheritDoc} */ @Override public void systemBooted() { boolean bindKeyguardNow = false; synchronized (mLock) { // Time to bind Keyguard; take care to only bind it once, either here if ready or // in systemReady if not. if (mKeyguardDelegate != null) { bindKeyguardNow = true; } else { // Because mKeyguardDelegate is null, we know that the synchronized block in // systemReady didn't run yet and setting this will actually have an effect. mDeferBindKeyguard = true; } } if (bindKeyguardNow) { mKeyguardDelegate.bindService(mContext); mKeyguardDelegate.onBootCompleted(); } Loading
services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java +17 −10 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ public class KeyguardServiceDelegate { private final KeyguardState mKeyguardState = new KeyguardState(); private ShowListener mShowListenerWhenConnect; /* package */ static final class KeyguardState { private static final class KeyguardState { KeyguardState() { // Assume keyguard is showing and secure until we know for sure. This is here in // the event something checks before the service is actually started. Loading Loading @@ -119,8 +119,13 @@ public class KeyguardServiceDelegate { mKeyguardState.showing = false; mKeyguardState.showingAndNotOccluded = false; mKeyguardState.secure = false; synchronized (mKeyguardState) { // TODO: Fix synchronisation model in this class. The other state in this class // is at least self-healing but a race condition here can lead to the scrim being // stuck on keyguard-less devices. mKeyguardState.deviceHasKeyguard = false; hideScrim(); } } else { if (DEBUG) Log.v(TAG, "*** Keyguard started"); } Loading Loading @@ -307,6 +312,7 @@ public class KeyguardServiceDelegate { } public void showScrim() { synchronized (mKeyguardState) { if (!mKeyguardState.deviceHasKeyguard) return; mScrim.post(new Runnable() { @Override Loading @@ -315,6 +321,7 @@ public class KeyguardServiceDelegate { } }); } } public void hideScrim() { mScrim.post(new Runnable() { Loading