Send PhoneAccount register/unregistered intents to default dialer.

A few cleanups:
1. When sending the register/unregister phone account intents, previously
there was no attempt made to ensure the intents were only sent when a
new account was added, or an existing one was removed.  Cleaned this up
so that we don't over-send the intents.
2. Minor fix to account diff string in PhoneAccountRegistrar which would
cause icon to always be shown as a diff; removed since bitmaps can't be
compared.
3. Also sending the intents to the default dialer app as an explicit
intent.
Cherry-pick from aosp master to resolve conflicts.

Test: Manual
Bug: 37106957
Change-Id: I7fdaa3e225df6fe3aaf292f9b0b93042f69ca469
diff --git a/testapps/AndroidManifest.xml b/testapps/AndroidManifest.xml
index 6980a12..592145b 100644
--- a/testapps/AndroidManifest.xml
+++ b/testapps/AndroidManifest.xml
@@ -66,7 +66,8 @@
             <intent-filter>
                 <action android:name="android.server.telecom.testapps.ACTION_SEND_UPDATE_REQUEST_FROM_TEST_INCALL_SERVICE"/>
                 <action android:name="android.server.telecom.testapps.ACTION_SEND_UPGRADE_RESPONSE"/>
-                <data android:scheme="int" />
+                <action android:name="android.telecom.action.PHONE_ACCOUNT_REGISTERED"/>
+                <action android:name="android.telecom.action.PHONE_ACCOUNT_UNREGISTERED"/>
             </intent-filter>
         </receiver>
 
diff --git a/testapps/src/com/android/server/telecom/testapps/TestInCallServiceBroadcastReceiver.java b/testapps/src/com/android/server/telecom/testapps/TestInCallServiceBroadcastReceiver.java
index b6902bf..3371060 100644
--- a/testapps/src/com/android/server/telecom/testapps/TestInCallServiceBroadcastReceiver.java
+++ b/testapps/src/com/android/server/telecom/testapps/TestInCallServiceBroadcastReceiver.java
@@ -19,6 +19,7 @@
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
+import android.telecom.TelecomManager;
 import android.util.Log;
 
 /**
@@ -56,6 +57,12 @@
         } else if (ACTION_SEND_UPGRADE_RESPONSE.equals(action)) {
             final int videoState = Integer.parseInt(intent.getData().getSchemeSpecificPart());
             TestCallList.getInstance().sendUpgradeToVideoResponse(videoState);
+        } else if (TelecomManager.ACTION_PHONE_ACCOUNT_REGISTERED.equals(action)) {
+            Log.i(TAG, "onReceive: registered " + intent.getExtras().get(
+                    TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE));
+        } else if (TelecomManager.ACTION_PHONE_ACCOUNT_UNREGISTERED.equals(action)) {
+            Log.i(TAG, "onReceive: unregistered " + intent.getExtras().get(
+                    TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE));
         }
     }
 }