When received Carrier Config Change, refresh UI.
Flag: EXEMPT bug fix Fix: 340890663 Test: Manual test Change-Id: Ia78c2dfb7e567161bcbb8d1d622cdccb178778e0
This commit is contained in:
@@ -20,11 +20,14 @@ import static com.android.settings.network.MobileNetworkListFragment.collectAirp
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserManager;
|
||||
import android.provider.Settings;
|
||||
import android.telephony.CarrierConfigManager;
|
||||
import android.telephony.SubscriptionInfo;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
@@ -106,6 +109,15 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings impleme
|
||||
private SubscriptionInfoEntity mSubscriptionInfoEntity;
|
||||
private MobileNetworkInfoEntity mMobileNetworkInfoEntity;
|
||||
|
||||
private BroadcastReceiver mBrocastReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (intent.getAction().equals(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED)) {
|
||||
redrawPreferenceControllers();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public MobileNetworkSettings() {
|
||||
super(UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS);
|
||||
}
|
||||
@@ -351,6 +363,10 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings impleme
|
||||
mMobileNetworkRepository.updateEntity();
|
||||
// TODO: remove log after fixing b/182326102
|
||||
Log.d(LOG_TAG, "onResume() subId=" + mSubId);
|
||||
|
||||
IntentFilter intentFilter = new IntentFilter();
|
||||
intentFilter.addAction(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED);
|
||||
getContext().registerReceiver(mBrocastReceiver, intentFilter, Context.RECEIVER_EXPORTED);
|
||||
}
|
||||
|
||||
private void onSubscriptionDetailChanged() {
|
||||
@@ -370,6 +386,7 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings impleme
|
||||
@Override
|
||||
public void onPause() {
|
||||
mMobileNetworkRepository.removeRegister(this);
|
||||
getContext().unregisterReceiver(mBrocastReceiver);
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user