Reload APNs setting page when receive the intent ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED
Bug: 77250264 Test: Manual testing Change-Id: Ie28c67c89a2590425ff9c06153b53dac6cf141f0 Merged-In: Ie28c67c89a2590425ff9c06153b53dac6cf141f0
This commit is contained in:
@@ -110,7 +110,7 @@ public class ApnSettings extends RestrictedSettingsFragment implements
|
|||||||
|
|
||||||
private String mSelectedKey;
|
private String mSelectedKey;
|
||||||
|
|
||||||
private IntentFilter mMobileStateFilter;
|
private IntentFilter mIntentFilter;
|
||||||
|
|
||||||
private boolean mUnavailable;
|
private boolean mUnavailable;
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ public class ApnSettings extends RestrictedSettingsFragment implements
|
|||||||
super(UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS);
|
super(UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final BroadcastReceiver mMobileStateReceiver = new BroadcastReceiver() {
|
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
if (intent.getAction().equals(
|
if (intent.getAction().equals(
|
||||||
@@ -136,6 +136,11 @@ public class ApnSettings extends RestrictedSettingsFragment implements
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else if(intent.getAction().equals(
|
||||||
|
TelephonyManager.ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED)) {
|
||||||
|
if (!mRestoreDefaultApnMode) {
|
||||||
|
fillList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -161,8 +166,9 @@ public class ApnSettings extends RestrictedSettingsFragment implements
|
|||||||
final int subId = activity.getIntent().getIntExtra(SUB_ID,
|
final int subId = activity.getIntent().getIntExtra(SUB_ID,
|
||||||
SubscriptionManager.INVALID_SUBSCRIPTION_ID);
|
SubscriptionManager.INVALID_SUBSCRIPTION_ID);
|
||||||
|
|
||||||
mMobileStateFilter = new IntentFilter(
|
mIntentFilter = new IntentFilter(
|
||||||
TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
|
TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
|
||||||
|
mIntentFilter.addAction(TelephonyManager.ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED);
|
||||||
|
|
||||||
setIfOnlyAvailableForAdmins(true);
|
setIfOnlyAvailableForAdmins(true);
|
||||||
|
|
||||||
@@ -209,7 +215,7 @@ public class ApnSettings extends RestrictedSettingsFragment implements
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
getActivity().registerReceiver(mMobileStateReceiver, mMobileStateFilter);
|
getActivity().registerReceiver(mReceiver, mIntentFilter);
|
||||||
|
|
||||||
if (!mRestoreDefaultApnMode) {
|
if (!mRestoreDefaultApnMode) {
|
||||||
fillList();
|
fillList();
|
||||||
@@ -224,7 +230,7 @@ public class ApnSettings extends RestrictedSettingsFragment implements
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
getActivity().unregisterReceiver(mMobileStateReceiver);
|
getActivity().unregisterReceiver(mReceiver);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user