diff options
author | LuK1337 <priv.luk@gmail.com> | 2016-06-09 15:43:39 +0200 |
---|---|---|
committer | Ethan Chen <intervigil@gmail.com> | 2016-06-16 11:44:29 -0700 |
commit | 9f030e6860f40bea48c86d1d4cd7ae6120c1b930 (patch) | |
tree | ad7054bd6ccbf0c3ba71b53116ee4e7634453486 | |
parent | fa02b4c8a37789b985883e0752864c6010fdeead (diff) | |
download | android_packages_services_Telecomm-9f030e6860f40bea48c86d1d4cd7ae6120c1b930.tar.gz android_packages_services_Telecomm-9f030e6860f40bea48c86d1d4cd7ae6120c1b930.tar.bz2 android_packages_services_Telecomm-9f030e6860f40bea48c86d1d4cd7ae6120c1b930.zip |
Handle IllegalArgumentException while setting default calling sub
* How to reproduce:
1. Add new SIP account
2. Disable it in "All calling accounts"
3. Reboot
Change-Id: Iaa2546588464a34871d7da8bba0b366d0ca43ab8
-rw-r--r-- | src/com/android/server/telecom/PhoneAccountRegistrar.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/com/android/server/telecom/PhoneAccountRegistrar.java b/src/com/android/server/telecom/PhoneAccountRegistrar.java index ebd09fd5..e27cd20d 100644 --- a/src/com/android/server/telecom/PhoneAccountRegistrar.java +++ b/src/com/android/server/telecom/PhoneAccountRegistrar.java @@ -70,6 +70,7 @@ import java.io.InputStream; import java.lang.Integer; import java.lang.SecurityException; import java.lang.String; +import java.lang.IllegalArgumentException; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; @@ -246,12 +247,16 @@ public final class PhoneAccountRegistrar { return mState.accounts.get(i).getAccountHandle(); } - long subId = Long.parseLong(id); - Log.i(this, "getUserSelectedVoicePhoneAccount, voice subId = " - + voiceSubId + " subId = " + subId + " mId = " + id); - if (subId == voiceSubId) { - prefPhoneAccount = mState.accounts.get(i).getAccountHandle(); - break; + try { + long subId = Long.parseLong(id); + Log.i(this, "getUserSelectedVoicePhoneAccount, voice subId = " + + voiceSubId + " subId = " + subId + " mId = " + id); + if (subId == voiceSubId) { + prefPhoneAccount = mState.accounts.get(i).getAccountHandle(); + break; + } + } catch (IllegalArgumentException e) { + Log.w(this, "getUserSelectedVoicePhoneAccount, accountHandle ID = " + id); } } |