summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java
diff options
context:
space:
mode:
authorsxia <sxia@codeaurora.org>2021-05-25 11:31:16 +0800
committershaohua xia <sxia@codeaurora.org>2021-06-09 06:00:39 +0000
commit8a9ffba4facc3d6bc4af17af866392fd8e78b8e4 (patch)
treefbe7b5c2f66b7f14f1829eea3a50c6b612a85032 /packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java
parent12ac95a67c7626df650f9da8d6db84a2c72f57c8 (diff)
SystemUI:PIN unlock string still display after unlock
Caused by AOSP new refactor and it keeps the string in a view of the notification panel.Furthermore, the unlock string is not kindly design to 2 SIMs with PIN enabled. Fix it by setting the string to null under kinds of SIM state change event,even with 2 SIM PIN lock enabled. Change-Id: Ia0c5db950575cf78eb6dfbb85f9f090739c2298e CRs-Fixed:2947841
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java28
1 files changed, 20 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java
index 90d140eabb20..fadb19f7ce0c 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java
@@ -63,14 +63,19 @@ public class KeyguardSimPinViewController
KeyguardUpdateMonitorCallback mUpdateMonitorCallback = new KeyguardUpdateMonitorCallback() {
@Override
public void onSimStateChanged(int subId, int slotId, int simState) {
- if (DEBUG) Log.v(TAG, "onSimStateChanged(subId=" + subId + ",state=" + simState + ")");
- if (simState == TelephonyManager.SIM_STATE_READY) {
+ if (DEBUG) Log.v(TAG, "onSimStateChanged(subId=" + subId + ",slotId=" + slotId
+ + ",simState=" + simState + ")");
+
+ if ((simState == TelephonyManager.SIM_STATE_READY)
+ || (simState == TelephonyManager.SIM_STATE_LOADED)) {
mRemainingAttempts = -1;
resetState();
} else {
resetState();
}
}
+
+
};
protected KeyguardSimPinViewController(KeyguardSimPinView view,
@@ -97,7 +102,7 @@ public class KeyguardSimPinViewController
@Override
void resetState() {
super.resetState();
- if (DEBUG) Log.v(TAG, "Resetting state");
+ if (DEBUG) Log.v(TAG, "Resetting state mShowDefaultMessage="+mShowDefaultMessage);
handleSubInfoChangeIfNeeded();
mMessageAreaController.setMessage("");
if (mShowDefaultMessage) {
@@ -116,7 +121,6 @@ public class KeyguardSimPinViewController
public void onResume(int reason) {
super.onResume(reason);
mKeyguardUpdateMonitor.registerCallback(mUpdateMonitorCallback);
- mView.resetState();
}
@Override
@@ -129,6 +133,8 @@ public class KeyguardSimPinViewController
mSimUnlockProgressDialog.dismiss();
mSimUnlockProgressDialog = null;
}
+
+ mMessageAreaController.setMessage("");
}
@Override
@@ -346,11 +352,17 @@ public class KeyguardSimPinViewController
private void handleSubInfoChangeIfNeeded() {
int subId = mKeyguardUpdateMonitor
- .getNextSubIdForState(TelephonyManager.SIM_STATE_PIN_REQUIRED);
- if (subId != mSubId && SubscriptionManager.isValidSubscriptionId(subId)) {
- mSubId = subId;
+ .getUnlockedSubIdForState(TelephonyManager.SIM_STATE_PIN_REQUIRED);
+ if (SubscriptionManager.isValidSubscriptionId(subId)) {
+ if (DEBUG) Log.v(TAG, "handleSubInfoChangeIfNeeded mSubId="+mSubId+" subId="+ subId);
mShowDefaultMessage = true;
- mRemainingAttempts = -1;
+ if(subId != mSubId){
+ mSubId = subId;
+ mRemainingAttempts = -1;
+ }
+ }else{
+ //false by default and keep false except in PIN lock state
+ mShowDefaultMessage = false;
}
}
}