summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUma Maheswari Ramalingam <umam@codeaurora.org>2010-10-22 10:07:41 -0700
committerUma Maheswari Ramalingam <umam@codeaurora.org>2010-12-08 10:33:24 -0800
commitcc7605ce61c27e3688e33dbf2bcafd1c12788784 (patch)
treec8298e883799a12c075e26a8e0ae5d9b86639d19
parent2b858caecb3c293c47b48eed12a55a49e3039874 (diff)
downloadbase-cc7605ce61c27e3688e33dbf2bcafd1c12788784.tar.gz
Fix for phone app crash in Icc Card.
- Check for active phone in ICC handler before processing messages. - Boundary check for gsm/cdma subscription app index while retrieving the ICC Card App. Change-Id: I3d54447e8d48e3482763e78eeb2a737a34cec321
-rw-r--r--telephony/java/com/android/internal/telephony/IccCard.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/telephony/java/com/android/internal/telephony/IccCard.java b/telephony/java/com/android/internal/telephony/IccCard.java
index 90f9e8cad111..e270ce918904 100644
--- a/telephony/java/com/android/internal/telephony/IccCard.java
+++ b/telephony/java/com/android/internal/telephony/IccCard.java
@@ -487,6 +487,12 @@ public abstract class IccCard {
CommandsInterface.SERVICE_CLASS_DATA +
CommandsInterface.SERVICE_CLASS_FAX;
+ if (!mPhone.mIsTheCurrentActivePhone) {
+ Log.e(mLogTag, "Received message " + msg + "[" + msg.what
+ + "] while being destroyed. Ignoring.");
+ return;
+ }
+
switch (msg.what) {
case EVENT_RADIO_OFF_OR_NOT_AVAILABLE:
mState = null;
@@ -626,7 +632,13 @@ public abstract class IccCard {
index = mIccCardStatus.getGsmUmtsSubscriptionAppIndex();
}
- IccCardApplication app = mIccCardStatus.getApplication(index);
+ IccCardApplication app;
+ if (index >= 0 && index < IccCardStatus.CARD_MAX_APPS) {
+ app = mIccCardStatus.getApplication(index);
+ } else {
+ Log.e(mLogTag, "[IccCard] Invalid Subscription Application index:" + index);
+ return IccCard.State.ABSENT;
+ }
if (app == null) {
Log.e(mLogTag, "[IccCard] Subscription Application in not present");