Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de114834 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add SIM PIN caching availability in dump" into sc-dev

parents df6e31ae 6b4339e1
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -937,13 +937,21 @@ public class PinStorage extends Handler {

    /** Returns if the PIN cache is allowed for a given slot. */
    private boolean isCacheAllowed(int slotId) {
        // Check overall device support
        return isCacheAllowedByDevice() && isCacheAllowedByCarrier(slotId);
    }

    /** Returns if the PIN cache is allowed by the device. */
    private boolean isCacheAllowedByDevice() {
        if (!mContext.getResources().getBoolean(
                R.bool.config_allow_pin_storage_for_unattended_reboot)) {
            logv("Pin caching disabled in resources");
            return false;
        }
        // Check carrier configuration
        return true;
    }

    /** Returns if the PIN cache is allowed by carrier for a given slot. */
    private boolean isCacheAllowedByCarrier(int slotId) {
        PersistableBundle config = null;
        CarrierConfigManager configManager =
                mContext.getSystemService(CarrierConfigManager.class);
@@ -1161,6 +1169,11 @@ public class PinStorage extends Handler {
        pw.println(" mIsDeviceLocked=" + mIsDeviceLocked);
        pw.println(" isLongTermSecretKey=" + (boolean) (mLongTermSecretKey != null));
        pw.println(" isShortTermSecretKey=" + (boolean) (mShortTermSecretKey != null));
        pw.println(" isCacheAllowedByDevice=" + isCacheAllowedByDevice());
        int slotCount = getSlotCount();
        for (int i = 0; i < slotCount; i++) {
            pw.println(" isCacheAllowedByCarrier[" + i + "]=" + isCacheAllowedByCarrier(i));
        }
        if (VDBG) {
            SparseArray<StoredPin> storedPins = loadPinInformation();
            for (int i = 0; i < storedPins.size(); i++) {