summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/deviceinfo
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/settings/deviceinfo')
-rw-r--r--src/com/android/settings/deviceinfo/ImeiInformation.java13
-rw-r--r--src/com/android/settings/deviceinfo/SimStatus.java6
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;