From 66adad0ab9921afcf3aefab270c030ceee9888df Mon Sep 17 00:00:00 2001 From: twyen Date: Tue, 24 Apr 2018 13:51:08 -0700 Subject: Add "enabled" to SelectPhoneAccountDialogFragment. This is used to inform the user an account cannot be used right now. On most dual SIM devices, only a single SIM can make calls at the same time. The UI will be implemented in a followup CL. This CL also packs the parameters of SelectPhoneAccountDialogFragment into a proto. There are too many arguments and it needs structured representation. TEST=TAP Bug: 69675796,72618783 Test: TAP PiperOrigin-RevId: 194139636 Change-Id: I7d9f92c73b650654fff28ba625a2c8e3dfa0b96c --- .../android/dialer/dialpadview/SpecialCharSequenceMgr.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'java/com/android/dialer/dialpadview') diff --git a/java/com/android/dialer/dialpadview/SpecialCharSequenceMgr.java b/java/com/android/dialer/dialpadview/SpecialCharSequenceMgr.java index 9929ddd3b..d2652ee66 100644 --- a/java/com/android/dialer/dialpadview/SpecialCharSequenceMgr.java +++ b/java/com/android/dialer/dialpadview/SpecialCharSequenceMgr.java @@ -56,6 +56,7 @@ import com.android.contacts.common.database.NoNullCursorAsyncQueryHandler; import com.android.contacts.common.util.ContactDisplayUtils; import com.android.contacts.common.widget.SelectPhoneAccountDialogFragment; import com.android.contacts.common.widget.SelectPhoneAccountDialogFragment.SelectPhoneAccountListener; +import com.android.contacts.common.widget.SelectPhoneAccountDialogOptionsUtil; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.compat.telephony.TelephonyManagerCompat; @@ -234,10 +235,12 @@ public class SpecialCharSequenceMgr { } else { SelectPhoneAccountListener callback = new HandleAdnEntryAccountSelectedCallback(applicationContext, handler, sc); - DialogFragment dialogFragment = SelectPhoneAccountDialogFragment.newInstance( - subscriptionAccountHandles, callback, null); + SelectPhoneAccountDialogOptionsUtil.builderWithAccounts( + subscriptionAccountHandles) + .build(), + callback); dialogFragment.show(((Activity) context).getFragmentManager(), TAG_SELECT_ACCT_FRAGMENT); } @@ -292,7 +295,9 @@ public class SpecialCharSequenceMgr { DialogFragment dialogFragment = SelectPhoneAccountDialogFragment.newInstance( - subscriptionAccountHandles, listener, null); + SelectPhoneAccountDialogOptionsUtil.builderWithAccounts(subscriptionAccountHandles) + .build(), + listener); dialogFragment.show(((Activity) context).getFragmentManager(), TAG_SELECT_ACCT_FRAGMENT); } return true; -- cgit v1.2.3