Loading packages/Keyguard/src/com/android/keyguard/EmergencyButton.java +2 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,8 @@ public class EmergencyButton extends Button { == TelephonyManager.CALL_STATE_OFFHOOK) { mLockPatternUtils.resumeCall(); } else { final boolean bypassHandler = true; KeyguardUpdateMonitor.getInstance(mContext).reportEmergencyCallAction(bypassHandler); Intent intent = new Intent(ACTION_EMERGENCY_DIAL); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); Loading packages/Keyguard/src/com/android/keyguard/KeyguardFaceUnlockView.java +7 −0 Original line number Diff line number Diff line Loading @@ -295,6 +295,13 @@ public class KeyguardFaceUnlockView extends LinearLayout implements KeyguardSecu } } } @Override public void onEmergencyCallAction() { if (mBiometricUnlock != null) { mBiometricUnlock.stop(); } } }; @Override Loading packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +32 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,7 @@ public class KeyguardUpdateMonitor { private static final int MSG_SET_CURRENT_CLIENT_ID = 315; protected static final int MSG_SET_PLAYBACK_STATE = 316; protected static final int MSG_USER_INFO_CHANGED = 317; protected static final int MSG_REPORT_EMERGENCY_CALL_ACTION = 318; private static KeyguardUpdateMonitor sInstance; Loading Loading @@ -181,6 +182,9 @@ public class KeyguardUpdateMonitor { case MSG_USER_INFO_CHANGED: handleUserInfoChanged(msg.arg1); break; case MSG_REPORT_EMERGENCY_CALL_ACTION: handleReportEmergencyCallAction(); break; } } }; Loading Loading @@ -758,6 +762,18 @@ public class KeyguardUpdateMonitor { } } /** * Handle {@link #MSG_REPORT_EMERGENCY_CALL_ACTION} */ private void handleReportEmergencyCallAction() { for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.onEmergencyCallAction(); } } } public boolean isKeyguardVisible() { return mKeyguardIsVisible; } Loading Loading @@ -902,6 +918,22 @@ public class KeyguardUpdateMonitor { handleSimStateChange(new SimArgs(IccCardConstants.State.READY)); } /** * Report that the emergency call button has been pressed and the emergency dialer is * about to be displayed. * * @param bypassHandler runs immediately. * * NOTE: Must be called from UI thread if bypassHandler == true. */ public void reportEmergencyCallAction(boolean bypassHandler) { if (!bypassHandler) { mHandler.obtainMessage(MSG_REPORT_EMERGENCY_CALL_ACTION).sendToTarget(); } else { handleReportEmergencyCallAction(); } } public CharSequence getTelephonyPlmn() { return mTelephonyPlmn; } Loading packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java +4 −0 Original line number Diff line number Diff line Loading @@ -131,4 +131,8 @@ class KeyguardUpdateMonitorCallback { */ public void onMusicPlaybackStateChanged(int playbackState, long eventTime) { } /** * Called when the emergency call button is pressed. */ void onEmergencyCallAction() { } } Loading
packages/Keyguard/src/com/android/keyguard/EmergencyButton.java +2 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,8 @@ public class EmergencyButton extends Button { == TelephonyManager.CALL_STATE_OFFHOOK) { mLockPatternUtils.resumeCall(); } else { final boolean bypassHandler = true; KeyguardUpdateMonitor.getInstance(mContext).reportEmergencyCallAction(bypassHandler); Intent intent = new Intent(ACTION_EMERGENCY_DIAL); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); Loading
packages/Keyguard/src/com/android/keyguard/KeyguardFaceUnlockView.java +7 −0 Original line number Diff line number Diff line Loading @@ -295,6 +295,13 @@ public class KeyguardFaceUnlockView extends LinearLayout implements KeyguardSecu } } } @Override public void onEmergencyCallAction() { if (mBiometricUnlock != null) { mBiometricUnlock.stop(); } } }; @Override Loading
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +32 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,7 @@ public class KeyguardUpdateMonitor { private static final int MSG_SET_CURRENT_CLIENT_ID = 315; protected static final int MSG_SET_PLAYBACK_STATE = 316; protected static final int MSG_USER_INFO_CHANGED = 317; protected static final int MSG_REPORT_EMERGENCY_CALL_ACTION = 318; private static KeyguardUpdateMonitor sInstance; Loading Loading @@ -181,6 +182,9 @@ public class KeyguardUpdateMonitor { case MSG_USER_INFO_CHANGED: handleUserInfoChanged(msg.arg1); break; case MSG_REPORT_EMERGENCY_CALL_ACTION: handleReportEmergencyCallAction(); break; } } }; Loading Loading @@ -758,6 +762,18 @@ public class KeyguardUpdateMonitor { } } /** * Handle {@link #MSG_REPORT_EMERGENCY_CALL_ACTION} */ private void handleReportEmergencyCallAction() { for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.onEmergencyCallAction(); } } } public boolean isKeyguardVisible() { return mKeyguardIsVisible; } Loading Loading @@ -902,6 +918,22 @@ public class KeyguardUpdateMonitor { handleSimStateChange(new SimArgs(IccCardConstants.State.READY)); } /** * Report that the emergency call button has been pressed and the emergency dialer is * about to be displayed. * * @param bypassHandler runs immediately. * * NOTE: Must be called from UI thread if bypassHandler == true. */ public void reportEmergencyCallAction(boolean bypassHandler) { if (!bypassHandler) { mHandler.obtainMessage(MSG_REPORT_EMERGENCY_CALL_ACTION).sendToTarget(); } else { handleReportEmergencyCallAction(); } } public CharSequence getTelephonyPlmn() { return mTelephonyPlmn; } Loading
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java +4 −0 Original line number Diff line number Diff line Loading @@ -131,4 +131,8 @@ class KeyguardUpdateMonitorCallback { */ public void onMusicPlaybackStateChanged(int playbackState, long eventTime) { } /** * Called when the emergency call button is pressed. */ void onEmergencyCallAction() { } }