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

Commit 05830457 authored by xinhe's avatar xinhe
Browse files

Unable to unlock SIM with a PIN/PUK

call TelephonyManager.getSimState instead of accessing systemProperty
Bug:18489776
Bug:18259307

Change-Id: Ie95befc6e4aa8cfc26947a1cb2bf54b296dcb443
parent ed588e46
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.internal.telephony;

import android.app.ActivityManagerNative;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.ContentResolver;
@@ -27,6 +28,7 @@ import android.os.AsyncResult;
import android.os.Handler;
import android.os.Message;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.telephony.Rlog;
@@ -119,13 +121,22 @@ public class SubscriptionInfoUpdater extends Handler {
                    return;
                }
                if (IccCardConstants.INTENT_VALUE_ICC_READY.equals(simStatus)
                        || IccCardConstants.INTENT_VALUE_ICC_LOCKED.equals(simStatus)) {
                        || IccCardConstants.INTENT_VALUE_ICC_LOCKED.equals(simStatus)
                        || IccCardConstants.INTENT_VALUE_ICC_INTERNAL_LOCKED.equals(simStatus)) {
                    if (mIccId[slotId] != null && mIccId[slotId].equals(ICCID_STRING_FOR_NO_SIM)) {
                        logd("SIM" + (slotId + 1) + " hot plug in");
                        mIccId[slotId] = null;
                        mNeedUpdate = true;
                    }
                    //TODO: Use RetryManager to limit number of retries and do a exponential backoff
                    if (((PhoneProxy)mPhone[slotId]).getIccFileHandler() != null) {
                        queryIccId(slotId);
                    } else {
                        intent.putExtra(IccCardConstants.INTENT_KEY_ICC_STATE,
                                IccCardConstants.INTENT_VALUE_ICC_INTERNAL_LOCKED);
                        ActivityManagerNative.broadcastStickyIntent(intent,
                                "android.permission.READ_PHONE_STATE", UserHandle.USER_ALL);
                    }
                } else if (IccCardConstants.INTENT_VALUE_ICC_LOADED.equals(simStatus)) {
                    queryIccId(slotId);
                    if (mTelephonyMgr == null) {