diff options
author | Wink Saville <wink@google.com> | 2014-11-22 10:11:39 -0800 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2014-11-22 10:11:39 -0800 |
commit | 0183fb5394f105d544472a52b2b4ba628e01da92 (patch) | |
tree | 23c7cddc0bc6951e2508328233b28fb8e3853600 /src/com/android/settings/deviceinfo | |
parent | 9209ce852ab7fbed10772af20aa7ff75ec69a96c (diff) | |
download | packages_apps_Settings-0183fb5394f105d544472a52b2b4ba628e01da92.tar.gz packages_apps_Settings-0183fb5394f105d544472a52b2b4ba628e01da92.tar.bz2 packages_apps_Settings-0183fb5394f105d544472a52b2b4ba628e01da92.zip |
Additional changes to SubscriptionManager API as per API council.
bug: 17575308
Change-Id: Idd98aa46c15a9219ccf28091c62602ac8bf16c62
Diffstat (limited to 'src/com/android/settings/deviceinfo')
-rw-r--r-- | src/com/android/settings/deviceinfo/ImeiInformation.java | 13 | ||||
-rw-r--r-- | src/com/android/settings/deviceinfo/SimStatus.java | 6 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/com/android/settings/deviceinfo/ImeiInformation.java b/src/com/android/settings/deviceinfo/ImeiInformation.java index 921ef8e90..72d315870 100644 --- a/src/com/android/settings/deviceinfo/ImeiInformation.java +++ b/src/com/android/settings/deviceinfo/ImeiInformation.java @@ -42,9 +42,12 @@ public class ImeiInformation extends PreferenceActivity { private static final String KEY_IMEI = "imei"; private static final String KEY_IMEI_SV = "imei_sv"; + private SubscriptionManager mSubscriptionManager; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + mSubscriptionManager = SubscriptionManager.from(this); final TelephonyManager telephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); initPreferenceScreen(telephonyManager.getSimCount()); @@ -100,17 +103,17 @@ public class ImeiInformation extends PreferenceActivity { } } - private Phone getPhoneFromSlotId(int slotId) { - final List<SubscriptionInfo> subInfos = SubscriptionManager.getSubscriptionInfoUsingSlotId(slotId); + private Phone getPhoneFromSlotId(int slotIdx) { + final SubscriptionInfo subInfo = + mSubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex(slotIdx); - if (subInfos == null || subInfos.size() < 1) { + if (subInfo == null) { return null; } final Phone[] phones = PhoneFactory.getPhones(); for (int i = 0; i < phones.length; i++) { - // Currently we only operate with the first subscription of a SIM. - if (phones[i].getSubId() == subInfos.get(0).getSubscriptionId()) { + if (phones[i].getSubId() == subInfo.getSubscriptionId()) { return phones[i]; } } diff --git a/src/com/android/settings/deviceinfo/SimStatus.java b/src/com/android/settings/deviceinfo/SimStatus.java index 46addf3f3..11daf0c38 100644 --- a/src/com/android/settings/deviceinfo/SimStatus.java +++ b/src/com/android/settings/deviceinfo/SimStatus.java @@ -11,7 +11,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and -* limitations under the License. + * limitations under the License. */ package com.android.settings.deviceinfo; @@ -143,7 +143,7 @@ public class SimStatus extends PreferenceActivity { mSignalStrength = findPreference(KEY_SIGNAL_STRENGTH); for (int i = 0; i < mTelephonyManager.getSimCount(); i++) { - final SubscriptionInfo sir = Utils.findRecordBySlotId(i); + final SubscriptionInfo sir = Utils.findRecordBySlotId(this, i); if (sir != null) { mSelectableSubInfos.add(sir); } @@ -355,7 +355,7 @@ public class SimStatus extends PreferenceActivity { final Phone phone = PhoneFactory.getPhone(SubscriptionManager.getPhoneId( mSir.getSubscriptionId())); if (UserHandle.myUserId() == UserHandle.USER_OWNER - && mSir.getSubscriptionId() != SubscriptionManager.INVALID_SUB_ID) { + && mSir.getSubscriptionId() != SubscriptionManager.INVALID_SUBSCRIPTION_ID) { if (phone == null) { Log.e(TAG, "Unable to locate a phone object for the given Subscription ID."); return; |