Add intent for enabling phone account.
Bug: 20303449
Change-Id: If6e717260df01160308fd395a6aac413aa5206d5
diff --git a/src/com/android/server/telecom/PhoneAccountRegistrar.java b/src/com/android/server/telecom/PhoneAccountRegistrar.java
index 1ef869b..3d539cb 100644
--- a/src/com/android/server/telecom/PhoneAccountRegistrar.java
+++ b/src/com/android/server/telecom/PhoneAccountRegistrar.java
@@ -350,12 +350,16 @@
public void enablePhoneAccount(PhoneAccountHandle accountHandle, boolean isEnabled) {
PhoneAccount account = getPhoneAccount(accountHandle);
- if (account.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) {
+ if (account == null) {
+ Log.w(this, "Could not find account to enable: " + accountHandle);
+ return;
+ } else if (account.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) {
// We never change the enabled state of SIM-based accounts.
+ Log.w(this, "Could not change enable state of SIM account: " + accountHandle);
return;
}
- if (account != null && account.isEnabled() != isEnabled) {
+ if (account.isEnabled() != isEnabled) {
account.setIsEnabled(isEnabled);
write();
fireAccountsChanged();