diff options
author | Nancy Chen <nancychen@google.com> | 2014-06-18 17:16:10 -0700 |
---|---|---|
committer | Nancy Chen <nancychen@google.com> | 2014-06-19 16:54:38 -0700 |
commit | 8e0662990043a3b430a96d8e94b9d773f5a4deff (patch) | |
tree | 94afbefc9dc36d17f3ae5a82baf590e611f7480a /src/com/android/dialer/dialpad | |
parent | da9fe01f539ca50251003d5c783aec434be23d3c (diff) |
Add reference to TelephonyManager, renaming, remove checkbox (1/2)
Incorporating API calls to TelephonyManager.getSubscriptions.
Added new SubscriptionManager class to wrap data about subscriptions for
the purpose of passing between Dialer and its fragments.
* This particular CL deals with the renaming of the menu strings and the
* passing of data between the Dialer and its fragments.
Bug: 15473965
Change-Id: Id52b925c618952bd77970c157fa63e665203b04c
Diffstat (limited to 'src/com/android/dialer/dialpad')
-rw-r--r-- | src/com/android/dialer/dialpad/DialpadFragment.java | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index bb5880295..e7ae7ccad 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -71,7 +71,8 @@ import android.widget.TextView; import com.android.contacts.common.CallUtil; import com.android.contacts.common.GeoUtil; -import com.android.contacts.common.dialog.SelectSIMDialogFragment; +import com.android.contacts.common.SubscriptionManager; +import com.android.contacts.common.dialog.SelectSubscriptionDialogFragment; import com.android.contacts.common.dialpad.DialpadKeyButton; import com.android.contacts.common.dialpad.DialpadView; import com.android.contacts.common.util.PhoneNumberFormatter; @@ -99,15 +100,7 @@ public class DialpadFragment extends Fragment DialpadKeyButton.OnPressedListener { private static final String TAG = DialpadFragment.class.getSimpleName(); - /** - * Constant to indicate there is only a single service provider available - */ - private static final int NO_MULTI_SIM = -1; - - /** - * Information about the currently selected SIM card. - */ - private int mCurrentSimCard = NO_MULTI_SIM; + private static SubscriptionManager mSubscriptionManager; /** * This interface allows the DialpadFragment to tell its hosting Activity when and when not @@ -861,9 +854,9 @@ public class DialpadFragment extends Fragment @Override public void show() { final Menu menu = getMenu(); - final MenuItem selectSim = menu.findItem(R.id.menu_select_sim); + final MenuItem selectSubscription = menu.findItem(R.id.menu_select_subscription); final MenuItem sendMessage = menu.findItem(R.id.menu_send_message); - selectSim.setVisible(mCurrentSimCard != NO_MULTI_SIM); + selectSubscription.setVisible(mSubscriptionManager != null); sendMessage.setVisible(mSmsPackageComponentName != null); boolean enable = !isDigitsEmpty(); @@ -1448,8 +1441,8 @@ public class DialpadFragment extends Fragment smsIntent.setComponent(mSmsPackageComponentName); DialerUtils.startActivityWithErrorToast(getActivity(), smsIntent); } - case R.id.menu_select_sim: - SelectSIMDialogFragment.show(getFragmentManager(), mCurrentSimCard); + case R.id.menu_select_subscription: + SelectSubscriptionDialogFragment.show(getFragmentManager(), mSubscriptionManager); return true; default: @@ -1621,8 +1614,8 @@ public class DialpadFragment extends Fragment return mAnimate; } - public void setSimCard(int simId) { - mCurrentSimCard = simId; + public void setSubscriptionManager(SubscriptionManager subscriptionManager) { + mSubscriptionManager = subscriptionManager; } public void setYFraction(float yFraction) { |