Skip to content

Commit a910a04

Browse files
MonkopediaAndroid (Google) Code Review
authored andcommitted
Merge "Fix crash in NetworkControllerImpl" into mnc-dev
2 parents 091f0e5 + 1c040db commit a910a04

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2913,7 +2913,7 @@ protected void onConfigurationChanged(Configuration newConfig) {
29132913
updateRowStates();
29142914
mIconController.updateResources();
29152915
mScreenPinningRequest.onConfigurationChanged();
2916-
mNetworkController.handleConfigurationChanged();
2916+
mNetworkController.onConfigurationChanged();
29172917
}
29182918

29192919
@Override

packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ private void registerListeners() {
197197
filter.addAction(TelephonyIntents.SPN_STRINGS_UPDATED_ACTION);
198198
filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
199199
filter.addAction(ConnectivityManager.INET_CONDITION_ACTION);
200-
filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
201200
filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED);
202201
mContext.registerReceiver(this, filter, null, mReceiverHandler);
203202
mListening = true;
@@ -339,8 +338,6 @@ public void onReceive(Context context, Intent intent) {
339338
if (action.equals(ConnectivityManager.CONNECTIVITY_ACTION) ||
340339
action.equals(ConnectivityManager.INET_CONDITION_ACTION)) {
341340
updateConnectivity();
342-
} else if (action.equals(Intent.ACTION_CONFIGURATION_CHANGED)) {
343-
handleConfigurationChanged();
344341
} else if (action.equals(Intent.ACTION_AIRPLANE_MODE_CHANGED)) {
345342
refreshLocale();
346343
updateAirplaneMode(false);
@@ -373,8 +370,18 @@ public void onReceive(Context context, Intent intent) {
373370
}
374371
}
375372

376-
public void handleConfigurationChanged() {
373+
public void onConfigurationChanged() {
377374
mConfig = Config.readConfig(mContext);
375+
mReceiverHandler.post(new Runnable() {
376+
@Override
377+
public void run() {
378+
handleConfigurationChanged();
379+
}
380+
});
381+
}
382+
383+
@VisibleForTesting
384+
void handleConfigurationChanged() {
378385
for (MobileSignalController mobileSignalController : mMobileSignalControllers.values()) {
379386
mobileSignalController.setConfiguration(mConfig);
380387
}

0 commit comments

Comments
 (0)