[Settings] Cannot use UnsupportedAppUsage API, use #hasIccCard() to replace

Bug: 145967955
Test: make
Change-Id: I8b948d1d416e1eb79e34be073b8ad81645d5ebb1
Merged-In: I8b948d1d416e1eb79e34be073b8ad81645d5ebb1
This commit is contained in:
zoey chen
2019-12-10 17:44:05 +08:00
parent e9b3f3303e
commit d54004f45e
2 changed files with 6 additions and 3 deletions

View File

@@ -38,7 +38,7 @@ public class SimLockPreferenceController extends BasePreferenceController {
private final CarrierConfigManager mCarrierConfigManager;
private final UserManager mUserManager;
private final SubscriptionManager mSubscriptionManager;
private final TelephonyManager mTelephonyManager;
private TelephonyManager mTelephonyManager;
public SimLockPreferenceController(Context context) {
super(context, KEY_SIM_LOCK);
@@ -99,7 +99,9 @@ public class SimLockPreferenceController extends BasePreferenceController {
if (subInfoList != null) {
for (SubscriptionInfo subInfo : subInfoList) {
if (mTelephonyManager.hasIccCard(subInfo.getSimSlotIndex())) {
mTelephonyManager = mTelephonyManager
.createForSubscriptionId(subInfo.getSimSlotIndex());
if (mTelephonyManager.hasIccCard()) {
return true;
}
}