[Settings] Can not launch SIMs page correctly
The subId should be set from argument when launching MobileNetworkSettings by new SubSettings Test: atest Bug: 211843783 Change-Id: Ie2b675af278795930971c61d8b1c1c28b96bf0ee
This commit is contained in:
@@ -118,15 +118,19 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
|
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
|
||||||
|
if (getArguments() == null) {
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
if (intent != null) {
|
if (intent != null) {
|
||||||
mSubId = intent.getIntExtra(Settings.EXTRA_SUB_ID,
|
mSubId = intent.getIntExtra(Settings.EXTRA_SUB_ID,
|
||||||
MobileNetworkUtils.getSearchableSubscriptionId(context));
|
MobileNetworkUtils.getSearchableSubscriptionId(context));
|
||||||
Log.i(LOG_TAG, "display subId from intent: " + mSubId);
|
Log.d(LOG_TAG, "display subId from intent: " + mSubId);
|
||||||
|
} else {
|
||||||
|
Log.d(LOG_TAG, "intent is null, can not get the subId from intent.");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mSubId = getArguments().getInt(Settings.EXTRA_SUB_ID,
|
mSubId = getArguments().getInt(Settings.EXTRA_SUB_ID,
|
||||||
MobileNetworkUtils.getSearchableSubscriptionId(context));
|
MobileNetworkUtils.getSearchableSubscriptionId(context));
|
||||||
Log.i(LOG_TAG, "display subId from getArguments(): " + mSubId);
|
Log.d(LOG_TAG, "display subId from getArguments(): " + mSubId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SubscriptionManager.isValidSubscriptionId(mSubId)) {
|
if (!SubscriptionManager.isValidSubscriptionId(mSubId)) {
|
||||||
|
@@ -1014,10 +1014,11 @@ public class MobileNetworkUtils {
|
|||||||
public static void launchMobileNetworkSettings(Context context, SubscriptionInfo info) {
|
public static void launchMobileNetworkSettings(Context context, SubscriptionInfo info) {
|
||||||
final int subId = info.getSubscriptionId();
|
final int subId = info.getSubscriptionId();
|
||||||
if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||||
Log.d(TAG, "launchMobileNetworkSettings fail, subId is invalid");
|
Log.d(TAG, "launchMobileNetworkSettings fail, subId is invalid.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log.d(TAG, "launchMobileNetworkSettings for subId: " + subId);
|
||||||
final Bundle extra = new Bundle();
|
final Bundle extra = new Bundle();
|
||||||
extra.putInt(Settings.EXTRA_SUB_ID, subId);
|
extra.putInt(Settings.EXTRA_SUB_ID, subId);
|
||||||
new SubSettingLauncher(context)
|
new SubSettingLauncher(context)
|
||||||
|
Reference in New Issue
Block a user