Remove SelectAccountDialogFragment for PhoneAccount on Dialer app (1/2)
One-time select will no longer be available within the dialer app so the
fragment and menu item have been removed.
Bug: 15473965
Change-Id: I13410b328f5b5ce887b8f3a9ba2c734d58008c56
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index b40a5fc..7e14e22 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -37,7 +37,6 @@
import android.provider.ContactsContract.Intents;
import android.speech.RecognizerIntent;
import android.support.v4.view.ViewPager;
-import android.telecomm.PhoneAccount;
import android.telephony.TelephonyManager;
import android.text.Editable;
import android.text.TextUtils;
@@ -63,10 +62,8 @@
import android.widget.Toast;
import com.android.contacts.common.CallUtil;
-import com.android.contacts.common.PhoneAccountManager;
import com.android.contacts.common.activity.TransactionSafeActivity;
import com.android.contacts.common.dialog.ClearFrequentsDialog;
-import com.android.contacts.common.dialog.SelectAccountDialogFragment;
import com.android.contacts.common.interactions.ImportExportDialogFragment;
import com.android.contacts.common.list.OnPhoneNumberPickerActionListener;
import com.android.contacts.common.widget.FloatingActionButtonController;
@@ -199,11 +196,6 @@
private boolean mIsLandscape;
/**
- * Information about the currently selected account.
- */
- private PhoneAccountManager mAccountManager = null;
-
- /**
* The position of the currently selected tab in the attached {@link ListsFragment}.
*/
private int mCurrentTabPosition = 0;
@@ -390,10 +382,6 @@
mIsLandscape = getResources().getConfiguration().orientation
== Configuration.ORIENTATION_LANDSCAPE;
- if (getTelephonyManager().getAccounts().size() > 1 && ENABLE_ACCOUNT_SELECT) {
- mAccountManager = new PhoneAccountManager(getTelephonyManager());
- }
-
final View floatingActionButtonContainer = findViewById(
R.id.floating_action_button_container);
mFloatingActionButton = (ImageButton) findViewById(R.id.floating_action_button);
@@ -601,9 +589,6 @@
case R.id.menu_call_settings:
handleMenuSettings();
return true;
- case R.id.menu_select_account:
- SelectAccountDialogFragment.show(getFragmentManager(), mAccountManager);
- return true;
}
return false;
}
@@ -638,7 +623,6 @@
}
mIsDialpadShown = true;
mDialpadFragment.setAnimate(animate);
- mDialpadFragment.setAccountManager(mAccountManager);
final FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.show(mDialpadFragment);
@@ -776,8 +760,6 @@
final OptionsPopupMenu popupMenu = new OptionsPopupMenu(this, invoker);
popupMenu.inflate(R.menu.dialtacts_options);
final Menu menu = popupMenu.getMenu();
- final MenuItem selectAccount = menu.findItem(R.id.menu_select_account);
- selectAccount.setVisible(mAccountManager != null);
popupMenu.setOnMenuItemClickListener(this);
return popupMenu;
}
@@ -1112,11 +1094,9 @@
@Override
public void onCallNumberDirectly(String phoneNumber, boolean isVideoCall) {
- final PhoneAccount account = mAccountManager != null ?
- mAccountManager.getCurrentAccount() : null;
Intent intent = isVideoCall ?
- CallUtil.getVideoCallIntent(phoneNumber, getCallOrigin(), account) :
- CallUtil.getCallIntent(phoneNumber, getCallOrigin(), account);
+ CallUtil.getVideoCallIntent(phoneNumber, getCallOrigin()) :
+ CallUtil.getCallIntent(phoneNumber, getCallOrigin());
DialerUtils.startActivityWithErrorToast(this, intent);
mClearSearchOnPause = true;
}