Crash upon selecting "Calling Accounts" in work Dialer
PhoneFactory is not inited in managed profile.
We need to call getSubIdForPhoneAccount in user 0 through TelephonyManager
Also, it is cleaner to move out the setting out of the telephony package
to avoid this happen again, but it is a bit late at this moment
Change-Id: I07d518d3550efdf1aa3a75af9ea91e80dd64bfcc
Fix: 28582158
diff --git a/src/com/android/phone/settings/PhoneAccountSettingsFragment.java b/src/com/android/phone/settings/PhoneAccountSettingsFragment.java
index 25c0f95..77de3f5 100644
--- a/src/com/android/phone/settings/PhoneAccountSettingsFragment.java
+++ b/src/com/android/phone/settings/PhoneAccountSettingsFragment.java
@@ -306,8 +306,8 @@
retval = isSim1 ? -1 : 1;
}
- int subId1 = PhoneUtils.getSubIdForPhoneAccount(account1);
- int subId2 = PhoneUtils.getSubIdForPhoneAccount(account2);
+ int subId1 = mTelephonyManager.getSubIdForPhoneAccount(account1);
+ int subId2 = mTelephonyManager.getSubIdForPhoneAccount(account2);
if (subId1 != SubscriptionManager.INVALID_SUBSCRIPTION_ID &&
subId2 != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
retval = (mSubscriptionManager.getSlotId(subId1) <