summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java
diff options
context:
space:
mode:
authorqingxi <qingxi@google.com>2017-05-24 15:33:13 -0700
committerqingxi <qingxi@google.com>2017-06-06 16:12:06 -0700
commit12f2de4f4fcdb5a20ddca80c340076bcc09cc8ea (patch)
tree5cfef45fe365f5ca9e61fb70b6a2253440515db4 /packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java
parente5ef67692ea9c53786ab82b458e0a5e8e34fdfac (diff)
Only show the "Disable eSIM" when eSIM profile is enabled
Before this CL, we always show "Disable eSIM" button in SIM lock screen if the device has eSIM chip. This may make the user who has never used eSIM or currently is not activated the eSIM Profile confused. This CL makes the "Disable eSIM" button only be shown iff the device has eSIM chip and the current activated Profile is eSIM profile. Bug: 37518023 Test: E2E Change-Id: Id5a1325f49733528a370ec7145fe49731243bcf7
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java
index d5be186ad166..4c7b48d1f438 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java
@@ -38,6 +38,7 @@ import android.telephony.TelephonyManager;
import android.telephony.euicc.EuiccManager;
import android.util.AttributeSet;
import android.util.Log;
+import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
@@ -78,6 +79,7 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
if (DEBUG) Log.v(TAG, "Resetting state");
KeyguardUpdateMonitor monitor = KeyguardUpdateMonitor.getInstance(mContext);
mSubId = monitor.getNextSubIdForState(IccCardConstants.State.PIN_REQUIRED);
+ boolean isEsimLocked = KeyguardEsimArea.isEsimLocked(mContext, mSubId);
if (SubscriptionManager.isValidSubscriptionId(mSubId)) {
int count = TelephonyManager.getDefault().getSimCount();
Resources rez = getResources();
@@ -93,14 +95,14 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
color = info.getIconTint();
}
}
- EuiccManager euiccManager =
- (EuiccManager) mContext.getSystemService(Context.EUICC_SERVICE);
- if (euiccManager.isEnabled()) {
+ if (isEsimLocked) {
msg = msg + " " + rez.getString(R.string.kg_sim_lock_instructions_esim);
}
mSecurityMessageDisplay.setMessage(msg);
mSimImageView.setImageTintList(ColorStateList.valueOf(color));
}
+ KeyguardEsimArea esimButton = findViewById(R.id.keyguard_esim_area);
+ esimButton.setVisibility(isEsimLocked ? View.VISIBLE : View.GONE);
}
@Override