diff options
author | kaiyiz <kaiyiz@codeaurora.org> | 2014-07-18 13:35:25 +0800 |
---|---|---|
committer | Roman Birg <roman@cyngn.com> | 2014-09-02 14:06:13 -0700 |
commit | a6cc76084c6cb2c84f2e914f7ef8d193f5fe34b8 (patch) | |
tree | 00b0237006cb1990db937d0ac74bf777c9c377c1 | |
parent | 3f1bd6d0f1c409375dfecc1c4922b2f6fc7769c9 (diff) | |
download | android_packages_apps_ContactsCommon-a6cc76084c6cb2c84f2e914f7ef8d193f5fe34b8.tar.gz android_packages_apps_ContactsCommon-a6cc76084c6cb2c84f2e914f7ef8d193f5fe34b8.tar.bz2 android_packages_apps_ContactsCommon-a6cc76084c6cb2c84f2e914f7ef8d193f5fe34b8.zip |
ContactsCommon: Check the validity of the subscription
The invalid sub index causes ArrayIndexOutOfBoundsException.
Add validity check for the subscription.
CRs-Fixed: 693678
Change-Id: Ia70453756c69349ac2c1b2dfe00e6c30b322c26c
-rw-r--r-- | src/com/android/contacts/common/MoreContactUtils.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/contacts/common/MoreContactUtils.java b/src/com/android/contacts/common/MoreContactUtils.java index fc258e9c..7f9d5774 100644 --- a/src/com/android/contacts/common/MoreContactUtils.java +++ b/src/com/android/contacts/common/MoreContactUtils.java @@ -860,7 +860,7 @@ public class MoreContactUtils { * Get SIM card aliases name, which defined in Settings */ public static String getMultiSimAliasesName(Context context, int subscription) { - if (context == null) { + if (context == null || subscription < 0) { return null; } String name = ""; |