File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
telephony/java/com/android/internal/telephony Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -487,6 +487,12 @@ public void handleMessage(Message msg){
487487 CommandsInterface .SERVICE_CLASS_DATA +
488488 CommandsInterface .SERVICE_CLASS_FAX ;
489489
490+ if (!mPhone .mIsTheCurrentActivePhone ) {
491+ Log .e (mLogTag , "Received message " + msg + "[" + msg .what
492+ + "] while being destroyed. Ignoring." );
493+ return ;
494+ }
495+
490496 switch (msg .what ) {
491497 case EVENT_RADIO_OFF_OR_NOT_AVAILABLE :
492498 mState = null ;
@@ -626,7 +632,13 @@ public State getIccCardState() {
626632 index = mIccCardStatus .getGsmUmtsSubscriptionAppIndex ();
627633 }
628634
629- IccCardApplication app = mIccCardStatus .getApplication (index );
635+ IccCardApplication app ;
636+ if (index >= 0 && index < IccCardStatus .CARD_MAX_APPS ) {
637+ app = mIccCardStatus .getApplication (index );
638+ } else {
639+ Log .e (mLogTag , "[IccCard] Invalid Subscription Application index:" + index );
640+ return IccCard .State .ABSENT ;
641+ }
630642
631643 if (app == null ) {
632644 Log .e (mLogTag , "[IccCard] Subscription Application in not present" );
You can’t perform that action at this time.
0 commit comments