Added logging in Telecom account registration loop.

Added abundant logging throughout the phone account registry process which could have been potentially causing a loop leading to battery depletion.

Bug: 258458772
Test: This change only increases logging so no new tests required.
Change-Id: Ia9dd690d474b99a4768edd6873f54ecd9ea3600d
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index ff4dcfe..688b039 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -11635,6 +11635,8 @@
         try {
             Phone phone = getPhone(subId);
             if (phone == null) return;
+            Log.i(LOG_TAG, "setVoiceServiceStateOverride: subId=" + subId + ", phone=" + phone
+                    + ", hasService=" + hasService + ", callingPackage=" + callingPackage);
             phone.setVoiceServiceStateOverride(hasService);
         } finally {
             Binder.restoreCallingIdentity(identity);
diff --git a/src/com/android/services/telephony/TelecomAccountRegistry.java b/src/com/android/services/telephony/TelecomAccountRegistry.java
index d92b136..6650eac 100644
--- a/src/com/android/services/telephony/TelecomAccountRegistry.java
+++ b/src/com/android/services/telephony/TelecomAccountRegistry.java
@@ -275,6 +275,8 @@
 
         private PhoneAccount registerPstnPhoneAccount(boolean isEmergency, boolean isTestAccount) {
             PhoneAccount account = buildPstnPhoneAccount(mIsEmergency, mIsTestAccount);
+            Log.i(this, "registerPstnPhoneAccount: Registering account=%s with "
+                    + "Telecom. subId=%d", account, getSubId());
             // Register with Telecom and put into the account entry.
             mTelecomManager.registerPhoneAccount(account);
             return account;
@@ -1175,7 +1177,10 @@
         @Override
         public void onServiceStateChanged(ServiceState serviceState) {
             int newState = serviceState.getState();
+            Log.i(this, "onServiceStateChanged: newState=%d, mServiceState=%d",
+                    newState, mServiceState);
             if (newState == ServiceState.STATE_IN_SERVICE && mServiceState != newState) {
+                Log.i(this, "onServiceStateChanged: Tearing down and re-setting up accounts.");
                 tearDownAccounts();
                 setupAccounts();
             } else {
@@ -1622,6 +1627,7 @@
 
             // Add a fake account entry.
             if (DBG && phones.length > 0 && "TRUE".equals(System.getProperty("test_sim"))) {
+                Log.i(this, "setupAccounts: adding a fake AccountEntry");
                 mAccounts.add(new AccountEntry(phones[0], false /* emergency */,
                         true /* isTest */));
             }