Loading api/system-current.txt +18 −2 Original line number Diff line number Diff line Loading @@ -11500,6 +11500,18 @@ package android.telephony { field public static final int PHYSICAL_CELL_ID_UNKNOWN = -1; // 0xffffffff } public final class PinResult implements android.os.Parcelable { method public int describeContents(); method public int getAttemptsRemaining(); method public int getResult(); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.telephony.PinResult> CREATOR; field public static final int PIN_RESULT_TYPE_ABORTED = 3; // 0x3 field public static final int PIN_RESULT_TYPE_FAILURE = 2; // 0x2 field public static final int PIN_RESULT_TYPE_INCORRECT = 1; // 0x1 field public static final int PIN_RESULT_TYPE_SUCCESS = 0; // 0x0 } public final class PreciseCallState implements android.os.Parcelable { ctor public PreciseCallState(int, int, int, int, int); method public int describeContents(); Loading Loading @@ -11843,6 +11855,7 @@ package android.telephony { public class TelephonyManager { method @Deprecated @RequiresPermission(android.Manifest.permission.CALL_PHONE) public void call(String, String); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult changeIccLockPin(@NonNull String, @NonNull String); method public int checkCarrierPrivilegesForPackage(String); method public int checkCarrierPrivilegesForPackageAnyPhone(String); method public void dial(String); Loading Loading @@ -11947,6 +11960,7 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataActivationState(int); method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataEnabled(int, boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataRoamingEnabled(boolean); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult setIccLockEnabled(boolean, @NonNull String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMobileDataPolicyEnabledStatus(int, boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMultiSimCarrierRestriction(boolean); method public int setNrDualConnectivityState(int); Loading @@ -11962,10 +11976,12 @@ package android.telephony { method @Deprecated public void setVisualVoicemailEnabled(android.telecom.PhoneAccountHandle, boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoiceActivationState(int); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void shutdownAllRadios(); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult supplyIccLockPin(@NonNull String); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult supplyIccLockPuk(@NonNull String, @NonNull String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean supplyPin(String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPinReportResult(String); method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPinReportResult(String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean supplyPuk(String, String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPukReportResult(String, String); method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPukReportResult(String, String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean switchSlots(int[]); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void toggleRadioOnOff(); method @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void updateOtaEmergencyNumberDbFilePath(@NonNull android.os.ParcelFileDescriptor); core/api/system-current.txt +18 −2 Original line number Diff line number Diff line Loading @@ -10341,6 +10341,18 @@ package android.telephony { field public static final int PHYSICAL_CELL_ID_UNKNOWN = -1; // 0xffffffff } public final class PinResult implements android.os.Parcelable { method public int describeContents(); method public int getAttemptsRemaining(); method public int getResult(); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.telephony.PinResult> CREATOR; field public static final int PIN_RESULT_TYPE_ABORTED = 3; // 0x3 field public static final int PIN_RESULT_TYPE_FAILURE = 2; // 0x2 field public static final int PIN_RESULT_TYPE_INCORRECT = 1; // 0x1 field public static final int PIN_RESULT_TYPE_SUCCESS = 0; // 0x0 } public final class PreciseCallState implements android.os.Parcelable { ctor public PreciseCallState(int, int, int, int, int); method public int describeContents(); Loading Loading @@ -10684,6 +10696,7 @@ package android.telephony { public class TelephonyManager { method @Deprecated @RequiresPermission(android.Manifest.permission.CALL_PHONE) public void call(String, String); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult changeIccLockPin(@NonNull String, @NonNull String); method public int checkCarrierPrivilegesForPackage(String); method public int checkCarrierPrivilegesForPackageAnyPhone(String); method public void dial(String); Loading Loading @@ -10788,6 +10801,7 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataActivationState(int); method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataEnabled(int, boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataRoamingEnabled(boolean); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult setIccLockEnabled(boolean, @NonNull String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMobileDataPolicyEnabledStatus(int, boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMultiSimCarrierRestriction(boolean); method public int setNrDualConnectivityState(int); Loading @@ -10803,10 +10817,12 @@ package android.telephony { method @Deprecated public void setVisualVoicemailEnabled(android.telecom.PhoneAccountHandle, boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoiceActivationState(int); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void shutdownAllRadios(); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult supplyIccLockPin(@NonNull String); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult supplyIccLockPuk(@NonNull String, @NonNull String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean supplyPin(String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPinReportResult(String); method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPinReportResult(String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean supplyPuk(String, String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPukReportResult(String, String); method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPukReportResult(String, String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean switchSlots(int[]); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void toggleRadioOnOff(); method @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void updateOtaEmergencyNumberDbFilePath(@NonNull android.os.ParcelFileDescriptor); packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java +9 −15 Original line number Diff line number Diff line Loading @@ -154,8 +154,8 @@ public class KeyguardSimPinViewController } 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; Loading @@ -163,7 +163,7 @@ public class KeyguardSimPinViewController true, KeyguardUpdateMonitor.getCurrentUser()); } else { mShowDefaultMessage = false; if (result.getType() == PinResult.PIN_RESULT_TYPE_INCORRECT) { if (result.getResult() == PinResult.PIN_RESULT_TYPE_INCORRECT) { if (result.getAttemptsRemaining() <= 2) { // this is getting critical - show dialog getSimRemainingAttemptsDialog( Loading Loading @@ -289,22 +289,16 @@ public class KeyguardSimPinViewController @Override public void run() { if (DEBUG) { Log.v(TAG, "call supplyPinReportResultForSubscriber(subid=" + mSubId + ")"); } TelephonyManager telephonyManager = mTelephonyManager.createForSubscriptionId(mSubId); final PinResult result = telephonyManager.supplyPinReportPinResult(mPin); if (result == null) { Log.e(TAG, "Error result for supplyPinReportResult."); mView.post(() -> onSimCheckResponse(PinResult.getDefaultFailedResult())); } else { Log.v(TAG, "call supplyIccLockPin(subid=" + mSubId + ")"); } TelephonyManager telephonyManager = mTelephonyManager.createForSubscriptionId(mSubId); final PinResult result = telephonyManager.supplyIccLockPin(mPin); if (DEBUG) { Log.v(TAG, "supplyPinReportResult returned: " + result.toString()); Log.v(TAG, "supplyIccLockPin returned: " + result.toString()); } mView.post(() -> onSimCheckResponse(result)); } } } private void setLockedSimMessage() { boolean isEsimLocked = KeyguardEsimArea.isEsimLocked(mView.getContext(), mSubId); Loading packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java +10 −18 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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, Loading Loading @@ -390,23 +390,15 @@ public class KeyguardSimPukViewController @Override public void run() { if (DEBUG) Log.v(TAG, "call supplyPukReportResult()"); 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); Log.v(TAG, "call supplyIccLockPuk(subid=" + mSubId + ")"); } }); TelephonyManager telephonyManager = mTelephonyManager.createForSubscriptionId(mSubId); final PinResult result = telephonyManager.supplyIccLockPuk(mPuk, mPin); if (DEBUG) { Log.v(TAG, "supplyIccLockPuk returned: " + result.toString()); } mView.post(() -> onSimLockChangedResponse(result)); } } Loading telephony/java/android/telephony/PinResult.java +41 −22 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.telephony; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; import android.os.Parcel; import android.os.Parcelable; Loading @@ -27,10 +28,16 @@ import com.android.internal.telephony.PhoneConstants; import java.util.Objects; /** * Holds the result from a pin attempt. * Holds the result from a PIN attempt. * * @see TelephonyManager#supplyIccLockPin * @see TelephonyManager#supplyIccLockPuk * @see TelephonyManager#setIccLockEnabled * @see TelephonyManager#changeIccLockPin * * @hide */ @SystemApi public final class PinResult implements Parcelable { /** @hide */ @IntDef({ Loading Loading @@ -64,24 +71,24 @@ public final class PinResult implements Parcelable { private static final PinResult sFailedResult = new PinResult(PinResult.PIN_RESULT_TYPE_FAILURE, -1); private final @PinResultType int mType; private final @PinResultType int mResult; private final int mAttemptsRemaining; /** * Returns either success, incorrect or failure. * Returns the result of the PIN attempt. * * @see #PIN_RESULT_TYPE_SUCCESS * @see #PIN_RESULT_TYPE_INCORRECT * @see #PIN_RESULT_TYPE_FAILURE * @return The result type of the pin attempt. * @return The result of the PIN attempt. */ public @PinResultType int getType() { return mType; public @PinResultType int getResult() { return mResult; } /** * The number of pin attempts remaining. * Returns the number of PIN attempts remaining. * This will be set when {@link #getResult} is {@link #PIN_RESULT_TYPE_INCORRECT}. * Indicates the number of attempts at entering the PIN before the SIM will be locked and * require a PUK unlock to be performed. * * @return Number of attempts remaining. */ Loading @@ -89,22 +96,32 @@ public final class PinResult implements Parcelable { return mAttemptsRemaining; } /** * Used to indicate a failed PIN attempt result. * * @return default PinResult for failure. * * @hide */ @NonNull public static PinResult getDefaultFailedResult() { return sFailedResult; } /** * PinResult constructor * PinResult constructor. * * @param type The type of pin result. * @param result The pin result value. * @see #PIN_RESULT_TYPE_SUCCESS * @see #PIN_RESULT_TYPE_INCORRECT * @see #PIN_RESULT_TYPE_FAILURE * @see #PIN_RESULT_TYPE_ABORTED * @param attemptsRemaining Number of pin attempts remaining. * * @hide */ public PinResult(@PinResultType int type, int attemptsRemaining) { mType = type; public PinResult(@PinResultType int result, int attemptsRemaining) { mResult = result; mAttemptsRemaining = attemptsRemaining; } Loading @@ -114,7 +131,7 @@ public final class PinResult implements Parcelable { * @hide */ private PinResult(Parcel in) { mType = in.readInt(); mResult = in.readInt(); mAttemptsRemaining = in.readInt(); } Loading @@ -124,11 +141,11 @@ public final class PinResult implements Parcelable { @NonNull @Override public String toString() { return "type: " + getType() + ", attempts remaining: " + getAttemptsRemaining(); return "result: " + getResult() + ", attempts remaining: " + getAttemptsRemaining(); } /** * Required to be Parcelable * Describe the contents of this object. */ @Override public int describeContents() { Loading @@ -136,15 +153,17 @@ public final class PinResult implements Parcelable { } /** * Required to be Parcelable * Write this object to a Parcel. */ @Override public void writeToParcel(@NonNull Parcel out, int flags) { out.writeInt(mType); out.writeInt(mResult); out.writeInt(mAttemptsRemaining); } /** Required to be Parcelable */ /** * Parcel creator class. */ public static final @NonNull Parcelable.Creator<PinResult> CREATOR = new Creator<PinResult>() { public PinResult createFromParcel(Parcel in) { return new PinResult(in); Loading @@ -156,7 +175,7 @@ public final class PinResult implements Parcelable { @Override public int hashCode() { return Objects.hash(mAttemptsRemaining, mType); return Objects.hash(mAttemptsRemaining, mResult); } @Override Loading @@ -171,7 +190,7 @@ public final class PinResult implements Parcelable { return false; } PinResult other = (PinResult) obj; return (mType == other.mType return (mResult == other.mResult && mAttemptsRemaining == other.mAttemptsRemaining); } } Loading
api/system-current.txt +18 −2 Original line number Diff line number Diff line Loading @@ -11500,6 +11500,18 @@ package android.telephony { field public static final int PHYSICAL_CELL_ID_UNKNOWN = -1; // 0xffffffff } public final class PinResult implements android.os.Parcelable { method public int describeContents(); method public int getAttemptsRemaining(); method public int getResult(); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.telephony.PinResult> CREATOR; field public static final int PIN_RESULT_TYPE_ABORTED = 3; // 0x3 field public static final int PIN_RESULT_TYPE_FAILURE = 2; // 0x2 field public static final int PIN_RESULT_TYPE_INCORRECT = 1; // 0x1 field public static final int PIN_RESULT_TYPE_SUCCESS = 0; // 0x0 } public final class PreciseCallState implements android.os.Parcelable { ctor public PreciseCallState(int, int, int, int, int); method public int describeContents(); Loading Loading @@ -11843,6 +11855,7 @@ package android.telephony { public class TelephonyManager { method @Deprecated @RequiresPermission(android.Manifest.permission.CALL_PHONE) public void call(String, String); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult changeIccLockPin(@NonNull String, @NonNull String); method public int checkCarrierPrivilegesForPackage(String); method public int checkCarrierPrivilegesForPackageAnyPhone(String); method public void dial(String); Loading Loading @@ -11947,6 +11960,7 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataActivationState(int); method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataEnabled(int, boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataRoamingEnabled(boolean); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult setIccLockEnabled(boolean, @NonNull String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMobileDataPolicyEnabledStatus(int, boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMultiSimCarrierRestriction(boolean); method public int setNrDualConnectivityState(int); Loading @@ -11962,10 +11976,12 @@ package android.telephony { method @Deprecated public void setVisualVoicemailEnabled(android.telecom.PhoneAccountHandle, boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoiceActivationState(int); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void shutdownAllRadios(); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult supplyIccLockPin(@NonNull String); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult supplyIccLockPuk(@NonNull String, @NonNull String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean supplyPin(String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPinReportResult(String); method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPinReportResult(String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean supplyPuk(String, String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPukReportResult(String, String); method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPukReportResult(String, String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean switchSlots(int[]); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void toggleRadioOnOff(); method @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void updateOtaEmergencyNumberDbFilePath(@NonNull android.os.ParcelFileDescriptor);
core/api/system-current.txt +18 −2 Original line number Diff line number Diff line Loading @@ -10341,6 +10341,18 @@ package android.telephony { field public static final int PHYSICAL_CELL_ID_UNKNOWN = -1; // 0xffffffff } public final class PinResult implements android.os.Parcelable { method public int describeContents(); method public int getAttemptsRemaining(); method public int getResult(); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.telephony.PinResult> CREATOR; field public static final int PIN_RESULT_TYPE_ABORTED = 3; // 0x3 field public static final int PIN_RESULT_TYPE_FAILURE = 2; // 0x2 field public static final int PIN_RESULT_TYPE_INCORRECT = 1; // 0x1 field public static final int PIN_RESULT_TYPE_SUCCESS = 0; // 0x0 } public final class PreciseCallState implements android.os.Parcelable { ctor public PreciseCallState(int, int, int, int, int); method public int describeContents(); Loading Loading @@ -10684,6 +10696,7 @@ package android.telephony { public class TelephonyManager { method @Deprecated @RequiresPermission(android.Manifest.permission.CALL_PHONE) public void call(String, String); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult changeIccLockPin(@NonNull String, @NonNull String); method public int checkCarrierPrivilegesForPackage(String); method public int checkCarrierPrivilegesForPackageAnyPhone(String); method public void dial(String); Loading Loading @@ -10788,6 +10801,7 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataActivationState(int); method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataEnabled(int, boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataRoamingEnabled(boolean); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult setIccLockEnabled(boolean, @NonNull String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMobileDataPolicyEnabledStatus(int, boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMultiSimCarrierRestriction(boolean); method public int setNrDualConnectivityState(int); Loading @@ -10803,10 +10817,12 @@ package android.telephony { method @Deprecated public void setVisualVoicemailEnabled(android.telecom.PhoneAccountHandle, boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoiceActivationState(int); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void shutdownAllRadios(); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult supplyIccLockPin(@NonNull String); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult supplyIccLockPuk(@NonNull String, @NonNull String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean supplyPin(String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPinReportResult(String); method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPinReportResult(String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean supplyPuk(String, String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPukReportResult(String, String); method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPukReportResult(String, String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean switchSlots(int[]); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void toggleRadioOnOff(); method @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void updateOtaEmergencyNumberDbFilePath(@NonNull android.os.ParcelFileDescriptor);
packages/SystemUI/src/com/android/keyguard/KeyguardSimPinViewController.java +9 −15 Original line number Diff line number Diff line Loading @@ -154,8 +154,8 @@ public class KeyguardSimPinViewController } 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; Loading @@ -163,7 +163,7 @@ public class KeyguardSimPinViewController true, KeyguardUpdateMonitor.getCurrentUser()); } else { mShowDefaultMessage = false; if (result.getType() == PinResult.PIN_RESULT_TYPE_INCORRECT) { if (result.getResult() == PinResult.PIN_RESULT_TYPE_INCORRECT) { if (result.getAttemptsRemaining() <= 2) { // this is getting critical - show dialog getSimRemainingAttemptsDialog( Loading Loading @@ -289,22 +289,16 @@ public class KeyguardSimPinViewController @Override public void run() { if (DEBUG) { Log.v(TAG, "call supplyPinReportResultForSubscriber(subid=" + mSubId + ")"); } TelephonyManager telephonyManager = mTelephonyManager.createForSubscriptionId(mSubId); final PinResult result = telephonyManager.supplyPinReportPinResult(mPin); if (result == null) { Log.e(TAG, "Error result for supplyPinReportResult."); mView.post(() -> onSimCheckResponse(PinResult.getDefaultFailedResult())); } else { Log.v(TAG, "call supplyIccLockPin(subid=" + mSubId + ")"); } TelephonyManager telephonyManager = mTelephonyManager.createForSubscriptionId(mSubId); final PinResult result = telephonyManager.supplyIccLockPin(mPin); if (DEBUG) { Log.v(TAG, "supplyPinReportResult returned: " + result.toString()); Log.v(TAG, "supplyIccLockPin returned: " + result.toString()); } mView.post(() -> onSimCheckResponse(result)); } } } private void setLockedSimMessage() { boolean isEsimLocked = KeyguardEsimArea.isEsimLocked(mView.getContext(), mSubId); Loading
packages/SystemUI/src/com/android/keyguard/KeyguardSimPukViewController.java +10 −18 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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, Loading Loading @@ -390,23 +390,15 @@ public class KeyguardSimPukViewController @Override public void run() { if (DEBUG) Log.v(TAG, "call supplyPukReportResult()"); 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); Log.v(TAG, "call supplyIccLockPuk(subid=" + mSubId + ")"); } }); TelephonyManager telephonyManager = mTelephonyManager.createForSubscriptionId(mSubId); final PinResult result = telephonyManager.supplyIccLockPuk(mPuk, mPin); if (DEBUG) { Log.v(TAG, "supplyIccLockPuk returned: " + result.toString()); } mView.post(() -> onSimLockChangedResponse(result)); } } Loading
telephony/java/android/telephony/PinResult.java +41 −22 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.telephony; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; import android.os.Parcel; import android.os.Parcelable; Loading @@ -27,10 +28,16 @@ import com.android.internal.telephony.PhoneConstants; import java.util.Objects; /** * Holds the result from a pin attempt. * Holds the result from a PIN attempt. * * @see TelephonyManager#supplyIccLockPin * @see TelephonyManager#supplyIccLockPuk * @see TelephonyManager#setIccLockEnabled * @see TelephonyManager#changeIccLockPin * * @hide */ @SystemApi public final class PinResult implements Parcelable { /** @hide */ @IntDef({ Loading Loading @@ -64,24 +71,24 @@ public final class PinResult implements Parcelable { private static final PinResult sFailedResult = new PinResult(PinResult.PIN_RESULT_TYPE_FAILURE, -1); private final @PinResultType int mType; private final @PinResultType int mResult; private final int mAttemptsRemaining; /** * Returns either success, incorrect or failure. * Returns the result of the PIN attempt. * * @see #PIN_RESULT_TYPE_SUCCESS * @see #PIN_RESULT_TYPE_INCORRECT * @see #PIN_RESULT_TYPE_FAILURE * @return The result type of the pin attempt. * @return The result of the PIN attempt. */ public @PinResultType int getType() { return mType; public @PinResultType int getResult() { return mResult; } /** * The number of pin attempts remaining. * Returns the number of PIN attempts remaining. * This will be set when {@link #getResult} is {@link #PIN_RESULT_TYPE_INCORRECT}. * Indicates the number of attempts at entering the PIN before the SIM will be locked and * require a PUK unlock to be performed. * * @return Number of attempts remaining. */ Loading @@ -89,22 +96,32 @@ public final class PinResult implements Parcelable { return mAttemptsRemaining; } /** * Used to indicate a failed PIN attempt result. * * @return default PinResult for failure. * * @hide */ @NonNull public static PinResult getDefaultFailedResult() { return sFailedResult; } /** * PinResult constructor * PinResult constructor. * * @param type The type of pin result. * @param result The pin result value. * @see #PIN_RESULT_TYPE_SUCCESS * @see #PIN_RESULT_TYPE_INCORRECT * @see #PIN_RESULT_TYPE_FAILURE * @see #PIN_RESULT_TYPE_ABORTED * @param attemptsRemaining Number of pin attempts remaining. * * @hide */ public PinResult(@PinResultType int type, int attemptsRemaining) { mType = type; public PinResult(@PinResultType int result, int attemptsRemaining) { mResult = result; mAttemptsRemaining = attemptsRemaining; } Loading @@ -114,7 +131,7 @@ public final class PinResult implements Parcelable { * @hide */ private PinResult(Parcel in) { mType = in.readInt(); mResult = in.readInt(); mAttemptsRemaining = in.readInt(); } Loading @@ -124,11 +141,11 @@ public final class PinResult implements Parcelable { @NonNull @Override public String toString() { return "type: " + getType() + ", attempts remaining: " + getAttemptsRemaining(); return "result: " + getResult() + ", attempts remaining: " + getAttemptsRemaining(); } /** * Required to be Parcelable * Describe the contents of this object. */ @Override public int describeContents() { Loading @@ -136,15 +153,17 @@ public final class PinResult implements Parcelable { } /** * Required to be Parcelable * Write this object to a Parcel. */ @Override public void writeToParcel(@NonNull Parcel out, int flags) { out.writeInt(mType); out.writeInt(mResult); out.writeInt(mAttemptsRemaining); } /** Required to be Parcelable */ /** * Parcel creator class. */ public static final @NonNull Parcelable.Creator<PinResult> CREATOR = new Creator<PinResult>() { public PinResult createFromParcel(Parcel in) { return new PinResult(in); Loading @@ -156,7 +175,7 @@ public final class PinResult implements Parcelable { @Override public int hashCode() { return Objects.hash(mAttemptsRemaining, mType); return Objects.hash(mAttemptsRemaining, mResult); } @Override Loading @@ -171,7 +190,7 @@ public final class PinResult implements Parcelable { return false; } PinResult other = (PinResult) obj; return (mType == other.mType return (mResult == other.mResult && mAttemptsRemaining == other.mAttemptsRemaining); } }