diff options
author | Sarah Chin <sarahchin@google.com> | 2020-10-29 16:28:16 -0700 |
---|---|---|
committer | Sarah Chin <sarahchin@google.com> | 2020-11-10 16:22:35 -0800 |
commit | 23057fc3f24515ba368bcb10dc431ecb8a13155b (patch) | |
tree | 09da585296b45602d3a0879170e355b6ffa2d813 /packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java | |
parent | 220e0256c98d27642c81b4f4609419f8a0fc3d49 (diff) |
Expose PinResult and ICC PIN/PUK APIs as SystemApi
Test: atest TelephonyManagerTest
Fix: 171884262
Change-Id: I9cdc11c49e4ca602cfa1464e5f424c4a96798cfe
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java index a87374939ba6..adb4c13b74d5 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java @@ -267,8 +267,8 @@ public class KeyguardSimPukViewController } mView.resetPasswordText(true /* animate */, /* announce */ - result.getType() != PinResult.PIN_RESULT_TYPE_SUCCESS); - if (result.getType() == PinResult.PIN_RESULT_TYPE_SUCCESS) { + result.getResult() != PinResult.PIN_RESULT_TYPE_SUCCESS); + if (result.getResult() == PinResult.PIN_RESULT_TYPE_SUCCESS) { mKeyguardUpdateMonitor.reportSimUnlocked(mSubId); mRemainingAttempts = -1; mShowDefaultMessage = true; @@ -277,7 +277,7 @@ public class KeyguardSimPukViewController true, KeyguardUpdateMonitor.getCurrentUser()); } else { mShowDefaultMessage = false; - if (result.getType() == PinResult.PIN_RESULT_TYPE_INCORRECT) { + if (result.getResult() == PinResult.PIN_RESULT_TYPE_INCORRECT) { // show message mMessageAreaController.setMessage(mView.getPukPasswordErrorMessage( result.getAttemptsRemaining(), false, @@ -390,23 +390,15 @@ public class KeyguardSimPukViewController @Override public void run() { - if (DEBUG) Log.v(TAG, "call supplyPukReportResult()"); + if (DEBUG) { + Log.v(TAG, "call supplyIccLockPuk(subid=" + mSubId + ")"); + } TelephonyManager telephonyManager = mTelephonyManager.createForSubscriptionId(mSubId); - final PinResult result = telephonyManager.supplyPukReportPinResult(mPuk, mPin); - if (result == null) { - Log.e(TAG, "Error result for supplyPukReportResult."); - mView.post(() -> onSimLockChangedResponse(PinResult.getDefaultFailedResult())); - } else { - if (DEBUG) { - Log.v(TAG, "supplyPukReportResult returned: " + result.toString()); - } - mView.post(new Runnable() { - @Override - public void run() { - onSimLockChangedResponse(result); - } - }); + final PinResult result = telephonyManager.supplyIccLockPuk(mPuk, mPin); + if (DEBUG) { + Log.v(TAG, "supplyIccLockPuk returned: " + result.toString()); } + mView.post(() -> onSimLockChangedResponse(result)); } } |