am 4811398b: Merge "Fix 10550373: Stopping FUL when emergency dialer opens" into klp-dev
* commit '4811398bfdaf4cf07f945c46d15977fd7418f498': Fix 10550373: Stopping FUL when emergency dialer opens
This commit is contained in:
@@ -102,6 +102,8 @@ public class EmergencyButton extends Button {
|
|||||||
== TelephonyManager.CALL_STATE_OFFHOOK) {
|
== TelephonyManager.CALL_STATE_OFFHOOK) {
|
||||||
mLockPatternUtils.resumeCall();
|
mLockPatternUtils.resumeCall();
|
||||||
} else {
|
} else {
|
||||||
|
final boolean bypassHandler = true;
|
||||||
|
KeyguardUpdateMonitor.getInstance(mContext).reportEmergencyCallAction(bypassHandler);
|
||||||
Intent intent = new Intent(ACTION_EMERGENCY_DIAL);
|
Intent intent = new Intent(ACTION_EMERGENCY_DIAL);
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
|
||||||
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
|
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
|
||||||
|
|||||||
@@ -295,6 +295,13 @@ public class KeyguardFaceUnlockView extends LinearLayout implements KeyguardSecu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEmergencyCallAction() {
|
||||||
|
if (mBiometricUnlock != null) {
|
||||||
|
mBiometricUnlock.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ public class KeyguardUpdateMonitor {
|
|||||||
private static final int MSG_SET_CURRENT_CLIENT_ID = 315;
|
private static final int MSG_SET_CURRENT_CLIENT_ID = 315;
|
||||||
protected static final int MSG_SET_PLAYBACK_STATE = 316;
|
protected static final int MSG_SET_PLAYBACK_STATE = 316;
|
||||||
protected static final int MSG_USER_INFO_CHANGED = 317;
|
protected static final int MSG_USER_INFO_CHANGED = 317;
|
||||||
|
protected static final int MSG_REPORT_EMERGENCY_CALL_ACTION = 318;
|
||||||
|
|
||||||
|
|
||||||
private static KeyguardUpdateMonitor sInstance;
|
private static KeyguardUpdateMonitor sInstance;
|
||||||
@@ -181,6 +182,9 @@ public class KeyguardUpdateMonitor {
|
|||||||
case MSG_USER_INFO_CHANGED:
|
case MSG_USER_INFO_CHANGED:
|
||||||
handleUserInfoChanged(msg.arg1);
|
handleUserInfoChanged(msg.arg1);
|
||||||
break;
|
break;
|
||||||
|
case MSG_REPORT_EMERGENCY_CALL_ACTION:
|
||||||
|
handleReportEmergencyCallAction();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -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() {
|
public boolean isKeyguardVisible() {
|
||||||
return mKeyguardIsVisible;
|
return mKeyguardIsVisible;
|
||||||
}
|
}
|
||||||
@@ -902,6 +918,22 @@ public class KeyguardUpdateMonitor {
|
|||||||
handleSimStateChange(new SimArgs(IccCardConstants.State.READY));
|
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() {
|
public CharSequence getTelephonyPlmn() {
|
||||||
return mTelephonyPlmn;
|
return mTelephonyPlmn;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,4 +131,8 @@ class KeyguardUpdateMonitorCallback {
|
|||||||
*/
|
*/
|
||||||
public void onMusicPlaybackStateChanged(int playbackState, long eventTime) { }
|
public void onMusicPlaybackStateChanged(int playbackState, long eventTime) { }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when the emergency call button is pressed.
|
||||||
|
*/
|
||||||
|
void onEmergencyCallAction() { }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user