Merge "[Telephony settings] Settings crashes when rotate screen in Preferred network type" am: 18e1a7c047
am: df73f7e090
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1432711 Change-Id: I1f0164ef41f5e21d9010a16c2cc8ea8d02e6c270
This commit is contained in:
@@ -81,7 +81,7 @@ public class MobileNetworkActivity extends SettingsBaseActivity
|
|||||||
mCurSubscriptionId = updateSubscriptionIndex;
|
mCurSubscriptionId = updateSubscriptionIndex;
|
||||||
mFragmentForceReload = (mCurSubscriptionId == oldSubId);
|
mFragmentForceReload = (mCurSubscriptionId == oldSubId);
|
||||||
final SubscriptionInfo info = getSubscription();
|
final SubscriptionInfo info = getSubscription();
|
||||||
updateSubscriptions(info);
|
updateSubscriptions(info, null);
|
||||||
|
|
||||||
// If the subscription has changed or the new intent doesnt contain the opt in action,
|
// If the subscription has changed or the new intent doesnt contain the opt in action,
|
||||||
// remove the old discovery dialog. If the activity is being recreated, we will see
|
// remove the old discovery dialog. If the activity is being recreated, we will see
|
||||||
@@ -132,7 +132,7 @@ public class MobileNetworkActivity extends SettingsBaseActivity
|
|||||||
// perform registration after mCurSubscriptionId been configured.
|
// perform registration after mCurSubscriptionId been configured.
|
||||||
registerActiveSubscriptionsListener();
|
registerActiveSubscriptionsListener();
|
||||||
|
|
||||||
updateSubscriptions(subscription);
|
updateSubscriptions(subscription, savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
@@ -154,7 +154,7 @@ public class MobileNetworkActivity extends SettingsBaseActivity
|
|||||||
public void onChanged() {
|
public void onChanged() {
|
||||||
SubscriptionInfo info = getSubscription();
|
SubscriptionInfo info = getSubscription();
|
||||||
int oldSubIndex = mCurSubscriptionId;
|
int oldSubIndex = mCurSubscriptionId;
|
||||||
updateSubscriptions(info);
|
updateSubscriptions(info, null);
|
||||||
|
|
||||||
// Remove the dialog if the subscription associated with this activity changes.
|
// Remove the dialog if the subscription associated with this activity changes.
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
@@ -209,14 +209,16 @@ public class MobileNetworkActivity extends SettingsBaseActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
void updateSubscriptions(SubscriptionInfo subscription) {
|
void updateSubscriptions(SubscriptionInfo subscription, Bundle savedInstanceState) {
|
||||||
if (subscription == null) {
|
if (subscription == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final int subscriptionIndex = subscription.getSubscriptionId();
|
final int subscriptionIndex = subscription.getSubscriptionId();
|
||||||
|
|
||||||
updateTitleAndNavigation(subscription);
|
updateTitleAndNavigation(subscription);
|
||||||
|
if (savedInstanceState == null) {
|
||||||
switchFragment(subscription);
|
switchFragment(subscription);
|
||||||
|
}
|
||||||
|
|
||||||
mCurSubscriptionId = subscriptionIndex;
|
mCurSubscriptionId = subscriptionIndex;
|
||||||
mFragmentForceReload = false;
|
mFragmentForceReload = false;
|
||||||
|
Reference in New Issue
Block a user