Remove work arounds for Hangouts

Change-Id: I599a856d2c5a54a4f5c42dde43a9cfbc1c091cf8
diff --git a/src/com/android/telecomm/PhoneAccountRegistrar.java b/src/com/android/telecomm/PhoneAccountRegistrar.java
index 56fe975..09ff547 100644
--- a/src/com/android/telecomm/PhoneAccountRegistrar.java
+++ b/src/com/android/telecomm/PhoneAccountRegistrar.java
@@ -16,25 +16,19 @@
 
 package com.android.telecomm;
 
-import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.util.FastXmlSerializer;
-import com.android.internal.util.XmlUtils;
-
 import android.telecomm.PhoneAccount;
 import android.telecomm.PhoneAccountHandle;
-
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-import org.xmlpull.v1.XmlSerializer;
-
 import android.content.ComponentName;
 import android.content.Context;
-
 import android.net.Uri;
 import android.telecomm.TelecommManager;
 import android.util.AtomicFile;
 import android.util.Xml;
 
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.util.FastXmlSerializer;
+import com.android.internal.util.XmlUtils;
+
 import java.io.BufferedInputStream;
 import java.io.BufferedOutputStream;
 import java.io.File;
@@ -47,6 +41,10 @@
 import java.util.Objects;
 import java.util.concurrent.CopyOnWriteArrayList;
 
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlSerializer;
+
 /**
  * Handles writing and reading PhoneAccountHandle registration entries. This is a simple verbatim
  * delegate for all the account handling methods on {@link TelecommManager} as implemented in
@@ -197,7 +195,6 @@
     // TODO: Should we implement an artificial limit for # of accounts associated with a single
     // ComponentName?
     public void registerPhoneAccount(PhoneAccount account) {
-        account = hackFixBabelAccount(account);
         mState.accounts.add(account);
         // Search for duplicates and remove any that are found.
         for (int i = 0; i < mState.accounts.size() - 1; i++) {
@@ -213,21 +210,6 @@
         fireAccountsChanged();
     }
 
-    // STOPSHIP: Hack to edit the account registered by Babel so it shows up properly
-    private PhoneAccount hackFixBabelAccount(PhoneAccount account) {
-        String pkg = account.getAccountHandle().getComponentName().getPackageName();
-        return "com.google.android.talk".equals(pkg)
-                ? new PhoneAccount(
-                        account.getAccountHandle(),
-                        account.getHandle(),
-                        account.getSubscriptionNumber(),
-                        PhoneAccount.CAPABILITY_CONNECTION_MANAGER,
-                        account.getIconResId(),
-                        account.getLabel(),
-                        account.getShortDescription())
-                : account;
-    }
-
     public void unregisterPhoneAccount(PhoneAccountHandle accountHandle) {
         for (int i = 0; i < mState.accounts.size(); i++) {
             if (Objects.equals(accountHandle, mState.accounts.get(i).getAccountHandle())) {
diff --git a/src/com/android/telecomm/TelecommApp.java b/src/com/android/telecomm/TelecommApp.java
index 0f4f776..9a075b2 100644
--- a/src/com/android/telecomm/TelecommApp.java
+++ b/src/com/android/telecomm/TelecommApp.java
@@ -17,10 +17,7 @@
 package com.android.telecomm;
 
 import android.app.Application;
-import android.content.ComponentName;
-import android.net.Uri;
 import android.os.UserHandle;
-import android.telecomm.PhoneAccount;
 import android.telecomm.PhoneAccountHandle;
 
 /**
@@ -50,8 +47,6 @@
         mMissedCallNotifier = new MissedCallNotifier(this);
         mPhoneAccountRegistrar = new PhoneAccountRegistrar(this);
 
-        addHangoutsAccount();
-
         if (UserHandle.myUserId() == UserHandle.USER_OWNER) {
             TelecommServiceImpl.init(mMissedCallNotifier, mPhoneAccountRegistrar);
         }
@@ -71,25 +66,4 @@
     PhoneAccountRegistrar getPhoneAccountRegistrar() {
         return mPhoneAccountRegistrar;
     }
-
-    private void addHangoutsAccount() {
-        // TODO: STOPSHIP. We are adding a hacked PhoneAccountHandle to ensure that Wi-Fi calling in
-        // Hangouts continues to work. This needs to be replaced with proper Wi-Fi calling wiring
-        // to the appropriate Connection Services.
-        PhoneAccount hangouts = new PhoneAccount(
-                new PhoneAccountHandle(
-                        new ComponentName(
-                                "com.google.android.talk",
-                                "com.google.android.apps.babel.telephony.TeleConnectionService"),
-                        "null_id"),
-                Uri.fromParts("tel", "null_uri", null),
-                "650-253-0000",
-                PhoneAccount.CAPABILITY_CALL_PROVIDER,
-                R.drawable.stat_sys_phone_call,
-                "Wi-Fi calling",
-                "Wi-Fi calling by Google Hangouts");
-        mPhoneAccountRegistrar.clearAccounts(
-                hangouts.getAccountHandle().getComponentName().getPackageName());
-        mPhoneAccountRegistrar.registerPhoneAccount(hangouts);
-    }
 }