diff options
author | Mick Lin <Mick.Lin@mediatek.com> | 2015-01-22 17:28:43 +0800 |
---|---|---|
committer | Leo Wang <leozwang@google.com> | 2015-01-27 05:30:47 +0000 |
commit | 09c9e5eb5d8d223b3b3faa29ce8b03f8873d0553 (patch) | |
tree | e8db99d941281378de4d31f3b4a9f10c548b0ee4 /src/com/android/settings/ApnEditor.java | |
parent | 9c167e92df8b42c5ff5955c1186cacd4dc44914d (diff) | |
download | packages_apps_Settings-09c9e5eb5d8d223b3b3faa29ce8b03f8873d0553.zip packages_apps_Settings-09c9e5eb5d8d223b3b3faa29ce8b03f8873d0553.tar.gz packages_apps_Settings-09c9e5eb5d8d223b3b3faa29ce8b03f8873d0553.tar.bz2 |
[DS] Correct the access method for telephony system property
Bug: 18675498
Review: https://partner-android-review.git.corp.google.com/#/c/198822
Change-Id: I7d6eab7d8f513de20bd8995b999a124097f725e7
Diffstat (limited to 'src/com/android/settings/ApnEditor.java')
-rw-r--r-- | src/com/android/settings/ApnEditor.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/settings/ApnEditor.java b/src/com/android/settings/ApnEditor.java index 6d88c50..4e14c60 100644 --- a/src/com/android/settings/ApnEditor.java +++ b/src/com/android/settings/ApnEditor.java @@ -34,6 +34,7 @@ import android.preference.Preference; import android.preference.PreferenceActivity; import android.preference.SwitchPreference; import android.provider.Telephony; +import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.util.Log; import android.view.KeyEvent; @@ -94,6 +95,7 @@ public class ApnEditor extends PreferenceActivity private Cursor mCursor; private boolean mNewApn; private boolean mFirstTime; + private int mSubId; private Resources mRes; private TelephonyManager mTelephonyManager; @@ -191,6 +193,7 @@ public class ApnEditor extends PreferenceActivity final Intent intent = getIntent(); final String action = intent.getAction(); + mSubId = intent.getIntExtra("sub_id", SubscriptionManager.INVALID_SUBSCRIPTION_ID); mFirstTime = icicle == null; @@ -263,8 +266,7 @@ public class ApnEditor extends PreferenceActivity mMnc.setText(mCursor.getString(MNC_INDEX)); mApnType.setText(mCursor.getString(TYPE_INDEX)); if (mNewApn) { - String numeric = - SystemProperties.get(TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC); + String numeric = mTelephonyManager.getSimOperator(mSubId); // MCC is first 3 chars and then in 2 - 3 chars of MNC if (numeric != null && numeric.length() > 4) { // Country code @@ -387,8 +389,7 @@ public class ApnEditor extends PreferenceActivity if (values[mvnoIndex].equals("SPN")) { mMvnoMatchData.setText(mTelephonyManager.getSimOperatorName()); } else if (values[mvnoIndex].equals("IMSI")) { - String numeric = - SystemProperties.get(TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC); + String numeric = mTelephonyManager.getSimOperator(mSubId); mMvnoMatchData.setText(numeric + "x"); } else if (values[mvnoIndex].equals("GID")) { mMvnoMatchData.setText(mTelephonyManager.getGroupIdLevel1()); |