Loading policy/Android.mk +2 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ $(call all-subdir-java-files) LOCAL_MODULE:= android.policy LOCAL_MODULE := android.policy_phone LOCAL_UNINSTALLABLE_MODULE := true include $(BUILD_JAVA_LIBRARY) policy/com/android/internal/policy/impl/KeyguardScreenCallback.java +5 −0 Original line number Diff line number Diff line Loading @@ -58,4 +58,9 @@ public interface KeyguardScreenCallback extends KeyguardViewCallback { */ void reportFailedPatternAttempt(); /** * Report whether we there's another way to unlock the device. * @return true */ boolean doesFallbackUnlockScreenExist(); } policy/com/android/internal/policy/impl/KeyguardUpdateMonitor.java +7 −7 Original line number Diff line number Diff line Loading @@ -160,8 +160,8 @@ public class KeyguardUpdateMonitor { } }; mDeviceProvisioned = Settings.System.getInt( mContext.getContentResolver(), Settings.System.DEVICE_PROVISIONED, 0) != 0; mDeviceProvisioned = Settings.Secure.getInt( mContext.getContentResolver(), Settings.Secure.DEVICE_PROVISIONED, 0) != 0; // Since device can't be un-provisioned, we only need to register a content observer // to update mDeviceProvisioned when we are... Loading @@ -170,8 +170,8 @@ public class KeyguardUpdateMonitor { @Override public void onChange(boolean selfChange) { super.onChange(selfChange); mDeviceProvisioned = Settings.System.getInt(mContext.getContentResolver(), Settings.System.DEVICE_PROVISIONED, 0) != 0; mDeviceProvisioned = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.DEVICE_PROVISIONED, 0) != 0; if (mDeviceProvisioned && mContentObserver != null) { // We don't need the observer anymore... mContext.getContentResolver().unregisterContentObserver(mContentObserver); Loading @@ -182,13 +182,13 @@ public class KeyguardUpdateMonitor { }; mContext.getContentResolver().registerContentObserver( Settings.System.getUriFor(Settings.System.DEVICE_PROVISIONED), Settings.Secure.getUriFor(Settings.Secure.DEVICE_PROVISIONED), false, mContentObserver); // prevent a race condition between where we check the flag and where we register the // observer by grabbing the value once again... mDeviceProvisioned = Settings.System.getInt(mContext.getContentResolver(), Settings.System.DEVICE_PROVISIONED, 0) != 0; mDeviceProvisioned = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.DEVICE_PROVISIONED, 0) != 0; } mInPortrait = queryInPortrait(); Loading policy/com/android/internal/policy/impl/KeyguardViewBase.java +14 −2 Original line number Diff line number Diff line Loading @@ -131,7 +131,13 @@ public abstract class KeyguardViewBase extends FrameLayout { final int keyCode = event.getKeyCode(); if (event.getAction() == KeyEvent.ACTION_DOWN) { switch (keyCode) { case KeyEvent.KEYCODE_HEADSETHOOK: { case KeyEvent.KEYCODE_HEADSETHOOK: case KeyEvent.KEYCODE_PLAYPAUSE: case KeyEvent.KEYCODE_STOP: case KeyEvent.KEYCODE_NEXTSONG: case KeyEvent.KEYCODE_PREVIOUSSONG: case KeyEvent.KEYCODE_REWIND: case KeyEvent.KEYCODE_FORWARD: { Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON, null); intent.putExtra(Intent.EXTRA_KEY_EVENT, event); getContext().sendOrderedBroadcast(intent, null); Loading Loading @@ -161,7 +167,13 @@ public abstract class KeyguardViewBase extends FrameLayout { } } else if (event.getAction() == KeyEvent.ACTION_UP) { switch (keyCode) { case KeyEvent.KEYCODE_HEADSETHOOK: { case KeyEvent.KEYCODE_HEADSETHOOK: case KeyEvent.KEYCODE_PLAYPAUSE: case KeyEvent.KEYCODE_STOP: case KeyEvent.KEYCODE_NEXTSONG: case KeyEvent.KEYCODE_PREVIOUSSONG: case KeyEvent.KEYCODE_REWIND: case KeyEvent.KEYCODE_FORWARD: { Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON, null); intent.putExtra(Intent.EXTRA_KEY_EVENT, event); getContext().sendOrderedBroadcast(intent, null); Loading policy/com/android/internal/policy/impl/KeyguardViewMediator.java +13 −1 Original line number Diff line number Diff line Loading @@ -131,6 +131,8 @@ public class KeyguardViewMediator implements KeyguardViewCallback, private Context mContext; private AlarmManager mAlarmManager; private boolean mSystemReady; /** Low level access to the power manager for enableUserActivity. Having this * requires that we run in the system process. */ LocalPowerManager mRealPowerManager; Loading Loading @@ -254,6 +256,7 @@ public class KeyguardViewMediator implements KeyguardViewCallback, public void onSystemReady() { synchronized (this) { if (DEBUG) Log.d(TAG, "onSystemReady"); mSystemReady = true; doKeyguard(); } } Loading Loading @@ -639,6 +642,12 @@ public class KeyguardViewMediator implements KeyguardViewCallback, case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_DOWN: case KeyEvent.KEYCODE_HEADSETHOOK: case KeyEvent.KEYCODE_PLAYPAUSE: case KeyEvent.KEYCODE_STOP: case KeyEvent.KEYCODE_NEXTSONG: case KeyEvent.KEYCODE_PREVIOUSSONG: case KeyEvent.KEYCODE_REWIND: case KeyEvent.KEYCODE_FORWARD: case KeyEvent.KEYCODE_CAMERA: return false; } Loading Loading @@ -806,6 +815,8 @@ public class KeyguardViewMediator implements KeyguardViewCallback, private void handleShow() { synchronized (KeyguardViewMediator.this) { if (DEBUG) Log.d(TAG, "handleShow"); if (!mSystemReady) return; // while we're showing, we control the wake state, so ask the power // manager not to honor request for userActivity. mRealPowerManager.enableUserActivity(false); Loading Loading @@ -875,6 +886,7 @@ public class KeyguardViewMediator implements KeyguardViewCallback, synchronized (KeyguardViewMediator.this) { if (DEBUG) Log.d(TAG, "handleVerifyUnlock"); mKeyguardViewManager.verifyUnlock(); mShowing = true; } } Loading Loading
policy/Android.mk +2 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ $(call all-subdir-java-files) LOCAL_MODULE:= android.policy LOCAL_MODULE := android.policy_phone LOCAL_UNINSTALLABLE_MODULE := true include $(BUILD_JAVA_LIBRARY)
policy/com/android/internal/policy/impl/KeyguardScreenCallback.java +5 −0 Original line number Diff line number Diff line Loading @@ -58,4 +58,9 @@ public interface KeyguardScreenCallback extends KeyguardViewCallback { */ void reportFailedPatternAttempt(); /** * Report whether we there's another way to unlock the device. * @return true */ boolean doesFallbackUnlockScreenExist(); }
policy/com/android/internal/policy/impl/KeyguardUpdateMonitor.java +7 −7 Original line number Diff line number Diff line Loading @@ -160,8 +160,8 @@ public class KeyguardUpdateMonitor { } }; mDeviceProvisioned = Settings.System.getInt( mContext.getContentResolver(), Settings.System.DEVICE_PROVISIONED, 0) != 0; mDeviceProvisioned = Settings.Secure.getInt( mContext.getContentResolver(), Settings.Secure.DEVICE_PROVISIONED, 0) != 0; // Since device can't be un-provisioned, we only need to register a content observer // to update mDeviceProvisioned when we are... Loading @@ -170,8 +170,8 @@ public class KeyguardUpdateMonitor { @Override public void onChange(boolean selfChange) { super.onChange(selfChange); mDeviceProvisioned = Settings.System.getInt(mContext.getContentResolver(), Settings.System.DEVICE_PROVISIONED, 0) != 0; mDeviceProvisioned = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.DEVICE_PROVISIONED, 0) != 0; if (mDeviceProvisioned && mContentObserver != null) { // We don't need the observer anymore... mContext.getContentResolver().unregisterContentObserver(mContentObserver); Loading @@ -182,13 +182,13 @@ public class KeyguardUpdateMonitor { }; mContext.getContentResolver().registerContentObserver( Settings.System.getUriFor(Settings.System.DEVICE_PROVISIONED), Settings.Secure.getUriFor(Settings.Secure.DEVICE_PROVISIONED), false, mContentObserver); // prevent a race condition between where we check the flag and where we register the // observer by grabbing the value once again... mDeviceProvisioned = Settings.System.getInt(mContext.getContentResolver(), Settings.System.DEVICE_PROVISIONED, 0) != 0; mDeviceProvisioned = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.DEVICE_PROVISIONED, 0) != 0; } mInPortrait = queryInPortrait(); Loading
policy/com/android/internal/policy/impl/KeyguardViewBase.java +14 −2 Original line number Diff line number Diff line Loading @@ -131,7 +131,13 @@ public abstract class KeyguardViewBase extends FrameLayout { final int keyCode = event.getKeyCode(); if (event.getAction() == KeyEvent.ACTION_DOWN) { switch (keyCode) { case KeyEvent.KEYCODE_HEADSETHOOK: { case KeyEvent.KEYCODE_HEADSETHOOK: case KeyEvent.KEYCODE_PLAYPAUSE: case KeyEvent.KEYCODE_STOP: case KeyEvent.KEYCODE_NEXTSONG: case KeyEvent.KEYCODE_PREVIOUSSONG: case KeyEvent.KEYCODE_REWIND: case KeyEvent.KEYCODE_FORWARD: { Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON, null); intent.putExtra(Intent.EXTRA_KEY_EVENT, event); getContext().sendOrderedBroadcast(intent, null); Loading Loading @@ -161,7 +167,13 @@ public abstract class KeyguardViewBase extends FrameLayout { } } else if (event.getAction() == KeyEvent.ACTION_UP) { switch (keyCode) { case KeyEvent.KEYCODE_HEADSETHOOK: { case KeyEvent.KEYCODE_HEADSETHOOK: case KeyEvent.KEYCODE_PLAYPAUSE: case KeyEvent.KEYCODE_STOP: case KeyEvent.KEYCODE_NEXTSONG: case KeyEvent.KEYCODE_PREVIOUSSONG: case KeyEvent.KEYCODE_REWIND: case KeyEvent.KEYCODE_FORWARD: { Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON, null); intent.putExtra(Intent.EXTRA_KEY_EVENT, event); getContext().sendOrderedBroadcast(intent, null); Loading
policy/com/android/internal/policy/impl/KeyguardViewMediator.java +13 −1 Original line number Diff line number Diff line Loading @@ -131,6 +131,8 @@ public class KeyguardViewMediator implements KeyguardViewCallback, private Context mContext; private AlarmManager mAlarmManager; private boolean mSystemReady; /** Low level access to the power manager for enableUserActivity. Having this * requires that we run in the system process. */ LocalPowerManager mRealPowerManager; Loading Loading @@ -254,6 +256,7 @@ public class KeyguardViewMediator implements KeyguardViewCallback, public void onSystemReady() { synchronized (this) { if (DEBUG) Log.d(TAG, "onSystemReady"); mSystemReady = true; doKeyguard(); } } Loading Loading @@ -639,6 +642,12 @@ public class KeyguardViewMediator implements KeyguardViewCallback, case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_DOWN: case KeyEvent.KEYCODE_HEADSETHOOK: case KeyEvent.KEYCODE_PLAYPAUSE: case KeyEvent.KEYCODE_STOP: case KeyEvent.KEYCODE_NEXTSONG: case KeyEvent.KEYCODE_PREVIOUSSONG: case KeyEvent.KEYCODE_REWIND: case KeyEvent.KEYCODE_FORWARD: case KeyEvent.KEYCODE_CAMERA: return false; } Loading Loading @@ -806,6 +815,8 @@ public class KeyguardViewMediator implements KeyguardViewCallback, private void handleShow() { synchronized (KeyguardViewMediator.this) { if (DEBUG) Log.d(TAG, "handleShow"); if (!mSystemReady) return; // while we're showing, we control the wake state, so ask the power // manager not to honor request for userActivity. mRealPowerManager.enableUserActivity(false); Loading Loading @@ -875,6 +886,7 @@ public class KeyguardViewMediator implements KeyguardViewCallback, synchronized (KeyguardViewMediator.this) { if (DEBUG) Log.d(TAG, "handleVerifyUnlock"); mKeyguardViewManager.verifyUnlock(); mShowing = true; } } Loading