Update TelecommManager per API requirements. (2/3)

+ Add constants GATEWAY_PROVIDER_PACKAGE and GATEWAY_ORIGINAL_ADDRESS
- Remove those corresponding constants from private packages
+ Modify clearAccounts() so it no longer takes an argument.

Bug: 17329632
Change-Id: I8b5f945f40dcab9e422ec2c69034a8e0c3249d0d
diff --git a/src/com/android/telecomm/ConnectionServiceWrapper.java b/src/com/android/telecomm/ConnectionServiceWrapper.java
index 00037ed..93211dc 100644
--- a/src/com/android/telecomm/ConnectionServiceWrapper.java
+++ b/src/com/android/telecomm/ConnectionServiceWrapper.java
@@ -28,12 +28,12 @@
 import android.telecomm.ConnectionRequest;
 import android.telecomm.ConnectionService;
 import android.telecomm.GatewayInfo;
-
 import android.telecomm.ParcelableConference;
 import android.telecomm.ParcelableConnection;
 import android.telecomm.PhoneAccount;
 import android.telecomm.PhoneAccountHandle;
 import android.telecomm.StatusHints;
+import android.telecomm.TelecommManager;
 import android.telecomm.VideoProfile;
 import android.telephony.DisconnectCause;
 
@@ -612,10 +612,10 @@
                         gatewayInfo.getOriginalAddress() != null) {
                     extras = (Bundle) extras.clone();
                     extras.putString(
-                            NewOutgoingCallIntentBroadcaster.EXTRA_GATEWAY_PROVIDER_PACKAGE,
+                            TelecommManager.GATEWAY_PROVIDER_PACKAGE,
                             gatewayInfo.getGatewayProviderPackageName());
                     extras.putParcelable(
-                            NewOutgoingCallIntentBroadcaster.EXTRA_GATEWAY_ORIGINAL_URI,
+                            TelecommManager.GATEWAY_ORIGINAL_ADDRESS,
                             gatewayInfo.getOriginalAddress());
                 }
 
diff --git a/tests/src/com/android/telecomm/testapps/CallServiceNotifier.java b/tests/src/com/android/telecomm/testapps/CallServiceNotifier.java
index 59047da..54cbe74 100644
--- a/tests/src/com/android/telecomm/testapps/CallServiceNotifier.java
+++ b/tests/src/com/android/telecomm/testapps/CallServiceNotifier.java
@@ -97,7 +97,7 @@
         TelecommManager telecommManager =
                 (TelecommManager) context.getSystemService(Context.TELECOMM_SERVICE);
 
-        telecommManager.clearAccounts(context.getPackageName());
+        telecommManager.clearAccounts();
 
         telecommManager.registerPhoneAccount(PhoneAccount.builder(
                         new PhoneAccountHandle(
diff --git a/tests/src/com/android/telecomm/testapps/TestConnectionService.java b/tests/src/com/android/telecomm/testapps/TestConnectionService.java
index 186bb5e..89bd8a9 100644
--- a/tests/src/com/android/telecomm/testapps/TestConnectionService.java
+++ b/tests/src/com/android/telecomm/testapps/TestConnectionService.java
@@ -51,11 +51,6 @@
  * TODO: Rename all classes in the directory to Dummy* (e.g., DummyConnectionService).
  */
 public class TestConnectionService extends ConnectionService {
-    public static final String EXTRA_GATEWAY_PROVIDER_PACKAGE =
-            "com.android.phone.extra.GATEWAY_PROVIDER_PACKAGE";
-    public static final String EXTRA_GATEWAY_ORIGINAL_URI =
-            "com.android.phone.extra.GATEWAY_ORIGINAL_URI";
-
     /**
      * Intent extra used to pass along whether a call is video or audio based on the user's choice
      * in the notification.
@@ -267,8 +262,8 @@
         }
 
         Bundle extras = originalRequest.getExtras();
-        String gatewayPackage = extras.getString(EXTRA_GATEWAY_PROVIDER_PACKAGE);
-        Uri originalHandle = extras.getParcelable(EXTRA_GATEWAY_ORIGINAL_URI);
+        String gatewayPackage = extras.getString(TelecommManager.GATEWAY_PROVIDER_PACKAGE);
+        Uri originalHandle = extras.getParcelable(TelecommManager.GATEWAY_ORIGINAL_ADDRESS);
 
         log("gateway package [" + gatewayPackage + "], original handle [" +
                 originalHandle + "]");
@@ -316,7 +311,8 @@
 
             // Use dummy number for testing incoming calls.
             Uri handle = providedHandle == null ?
-                    Uri.fromParts(PhoneAccount.SCHEME_TEL, getDummyNumber(isVideoCall), null) : providedHandle;
+                    Uri.fromParts(PhoneAccount.SCHEME_TEL, getDummyNumber(isVideoCall), null)
+                    : providedHandle;
             if (isVideoCall) {
                 TestVideoProvider testVideoCallProvider =
                         new TestVideoProvider(getApplicationContext());