Loading src/java/com/android/internal/telephony/uicc/UiccProfile.java +13 −15 Original line number Diff line number Diff line Loading @@ -459,20 +459,18 @@ public class UiccProfile extends Handler implements IccCard { } } private void broadcastInternalIccStateChangedIntent(String value, String reason) { synchronized (mLock) { static void broadcastInternalIccStateChangedIntent(String value, String reason, int phoneId) { Intent intent = new Intent(ACTION_INTERNAL_SIM_STATE_CHANGED); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND); intent.putExtra(PhoneConstants.PHONE_NAME_KEY, "Phone"); intent.putExtra(IccCardConstants.INTENT_KEY_ICC_STATE, value); intent.putExtra(IccCardConstants.INTENT_KEY_LOCKED_REASON, reason); intent.putExtra(PhoneConstants.PHONE_KEY, mPhoneId); // SubId may not be valid. intent.putExtra(PhoneConstants.PHONE_KEY, phoneId); // SubId may not be valid. log("Sending intent ACTION_INTERNAL_SIM_STATE_CHANGED value=" + value + " for mPhoneId : " + mPhoneId); + " for mPhoneId : " + phoneId); ActivityManager.broadcastStickyIntent(intent, UserHandle.USER_ALL); } } private void setExternalState(IccCardConstants.State newState, boolean override) { synchronized (mLock) { Loading Loading @@ -510,7 +508,7 @@ public class UiccProfile extends Handler implements IccCard { mTelephonyManager.setSimStateForPhone(mPhoneId, getState().toString()); broadcastInternalIccStateChangedIntent(getIccStateIntentString(mExternalState), getIccStateReason(mExternalState)); getIccStateReason(mExternalState), mPhoneId); } } Loading Loading @@ -1366,7 +1364,7 @@ public class UiccProfile extends Handler implements IccCard { return null; } private void log(String msg) { private static void log(String msg) { Rlog.d(LOG_TAG, msg); } Loading src/java/com/android/internal/telephony/uicc/UiccSlot.java +14 −3 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.view.WindowManager; import com.android.internal.R; import com.android.internal.telephony.CommandsInterface; import com.android.internal.telephony.CommandsInterface.RadioState; import com.android.internal.telephony.IccCardConstants; import com.android.internal.telephony.uicc.IccCardStatus.CardState; import java.io.FileDescriptor; Loading @@ -59,7 +60,9 @@ public class UiccSlot extends Handler { private RadioState mLastRadioState = RadioState.RADIO_UNAVAILABLE; private boolean mIsEuicc; private String mIccId; private Integer mPhoneId = null; // todo: remove if this is not needed private RegistrantList mAbsentRegistrants = new RegistrantList(); private static final int EVENT_CARD_REMOVED = 13; Loading @@ -81,6 +84,7 @@ public class UiccSlot extends Handler { synchronized (mLock) { CardState oldState = mCardState; mCardState = ics.mCardState; mPhoneId = phoneId; parseAtr(ics.atr); mCi = ci; Loading @@ -98,7 +102,8 @@ public class UiccSlot extends Handler { sendMessage(obtainMessage(EVENT_CARD_REMOVED, null)); } // todo: broadcast sim state changed for absent/unknown when IccCardProxy is removed UiccProfile.broadcastInternalIccStateChangedIntent( IccCardConstants.INTENT_VALUE_ICC_ABSENT, null, mPhoneId); // no card present in the slot now; dispose card and make mUiccCard null mUiccCard.dispose(); Loading @@ -118,7 +123,7 @@ public class UiccSlot extends Handler { } if (!mIsEuicc) { mUiccCard = new UiccCard(mContext, mCi, ics, phoneId); mUiccCard = new UiccCard(mContext, mCi, ics, mPhoneId); } else { // todo: initialize new EuiccCard object here //mUiccCard = new EuiccCard(); Loading @@ -144,6 +149,9 @@ public class UiccSlot extends Handler { mActive = false; // treat as radio state unavailable onRadioStateUnavailable(); // set mPhoneId to null only after sim state changed broadcast is sent as it // needs the phoneId. The broadcast is sent from onRadioStateUnavailable() mPhoneId = null; } parseAtr(iss.atr); mCardState = iss.cardState; Loading Loading @@ -304,7 +312,10 @@ public class UiccSlot extends Handler { } mUiccCard = null; // todo: broadcast sim state changed for absent/unknown when IccCardProxy is removed if (mPhoneId != null) { UiccProfile.broadcastInternalIccStateChangedIntent( IccCardConstants.INTENT_VALUE_ICC_UNKNOWN, null, mPhoneId); } mCardState = CardState.CARDSTATE_ABSENT; mLastRadioState = RadioState.RADIO_UNAVAILABLE; Loading Loading
src/java/com/android/internal/telephony/uicc/UiccProfile.java +13 −15 Original line number Diff line number Diff line Loading @@ -459,20 +459,18 @@ public class UiccProfile extends Handler implements IccCard { } } private void broadcastInternalIccStateChangedIntent(String value, String reason) { synchronized (mLock) { static void broadcastInternalIccStateChangedIntent(String value, String reason, int phoneId) { Intent intent = new Intent(ACTION_INTERNAL_SIM_STATE_CHANGED); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND); intent.putExtra(PhoneConstants.PHONE_NAME_KEY, "Phone"); intent.putExtra(IccCardConstants.INTENT_KEY_ICC_STATE, value); intent.putExtra(IccCardConstants.INTENT_KEY_LOCKED_REASON, reason); intent.putExtra(PhoneConstants.PHONE_KEY, mPhoneId); // SubId may not be valid. intent.putExtra(PhoneConstants.PHONE_KEY, phoneId); // SubId may not be valid. log("Sending intent ACTION_INTERNAL_SIM_STATE_CHANGED value=" + value + " for mPhoneId : " + mPhoneId); + " for mPhoneId : " + phoneId); ActivityManager.broadcastStickyIntent(intent, UserHandle.USER_ALL); } } private void setExternalState(IccCardConstants.State newState, boolean override) { synchronized (mLock) { Loading Loading @@ -510,7 +508,7 @@ public class UiccProfile extends Handler implements IccCard { mTelephonyManager.setSimStateForPhone(mPhoneId, getState().toString()); broadcastInternalIccStateChangedIntent(getIccStateIntentString(mExternalState), getIccStateReason(mExternalState)); getIccStateReason(mExternalState), mPhoneId); } } Loading Loading @@ -1366,7 +1364,7 @@ public class UiccProfile extends Handler implements IccCard { return null; } private void log(String msg) { private static void log(String msg) { Rlog.d(LOG_TAG, msg); } Loading
src/java/com/android/internal/telephony/uicc/UiccSlot.java +14 −3 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.view.WindowManager; import com.android.internal.R; import com.android.internal.telephony.CommandsInterface; import com.android.internal.telephony.CommandsInterface.RadioState; import com.android.internal.telephony.IccCardConstants; import com.android.internal.telephony.uicc.IccCardStatus.CardState; import java.io.FileDescriptor; Loading @@ -59,7 +60,9 @@ public class UiccSlot extends Handler { private RadioState mLastRadioState = RadioState.RADIO_UNAVAILABLE; private boolean mIsEuicc; private String mIccId; private Integer mPhoneId = null; // todo: remove if this is not needed private RegistrantList mAbsentRegistrants = new RegistrantList(); private static final int EVENT_CARD_REMOVED = 13; Loading @@ -81,6 +84,7 @@ public class UiccSlot extends Handler { synchronized (mLock) { CardState oldState = mCardState; mCardState = ics.mCardState; mPhoneId = phoneId; parseAtr(ics.atr); mCi = ci; Loading @@ -98,7 +102,8 @@ public class UiccSlot extends Handler { sendMessage(obtainMessage(EVENT_CARD_REMOVED, null)); } // todo: broadcast sim state changed for absent/unknown when IccCardProxy is removed UiccProfile.broadcastInternalIccStateChangedIntent( IccCardConstants.INTENT_VALUE_ICC_ABSENT, null, mPhoneId); // no card present in the slot now; dispose card and make mUiccCard null mUiccCard.dispose(); Loading @@ -118,7 +123,7 @@ public class UiccSlot extends Handler { } if (!mIsEuicc) { mUiccCard = new UiccCard(mContext, mCi, ics, phoneId); mUiccCard = new UiccCard(mContext, mCi, ics, mPhoneId); } else { // todo: initialize new EuiccCard object here //mUiccCard = new EuiccCard(); Loading @@ -144,6 +149,9 @@ public class UiccSlot extends Handler { mActive = false; // treat as radio state unavailable onRadioStateUnavailable(); // set mPhoneId to null only after sim state changed broadcast is sent as it // needs the phoneId. The broadcast is sent from onRadioStateUnavailable() mPhoneId = null; } parseAtr(iss.atr); mCardState = iss.cardState; Loading Loading @@ -304,7 +312,10 @@ public class UiccSlot extends Handler { } mUiccCard = null; // todo: broadcast sim state changed for absent/unknown when IccCardProxy is removed if (mPhoneId != null) { UiccProfile.broadcastInternalIccStateChangedIntent( IccCardConstants.INTENT_VALUE_ICC_UNKNOWN, null, mPhoneId); } mCardState = CardState.CARDSTATE_ABSENT; mLastRadioState = RadioState.RADIO_UNAVAILABLE; Loading