Implement API methods to get voicemail notification settings.
Bug: 24164917
Change-Id: I1364a89a12f506a74d65ab86f445ff662a776381
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index 983967c..1749df2 100644
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -2429,15 +2429,21 @@
}
public static int getSubIdForPhoneAccountHandle(PhoneAccountHandle handle) {
- if (handle != null && handle.getComponentName().equals(getPstnConnectionServiceName())) {
- Phone phone = getPhoneFromIccId(handle.getId());
- if (phone != null) {
- return phone.getSubId();
- }
+ Phone phone = getPhoneForPhoneAccountHandle(handle);
+ if (phone != null) {
+ return phone.getSubId();
}
return SubscriptionManager.INVALID_SUBSCRIPTION_ID;
}
+ static Phone getPhoneForPhoneAccountHandle(PhoneAccountHandle handle) {
+ if (handle != null && handle.getComponentName().equals(getPstnConnectionServiceName())) {
+ return getPhoneFromIccId(handle.getId());
+ }
+ return null;
+ }
+
+
/**
* Determine if a given phone account corresponds to an active SIM
*