Merge "wifi: Handle wifi ap initial state before register intent" into tm-qpr-dev am: b75858bf82

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19491094

Change-Id: I65a54ab88204a4dfd484a8faf157d6b9db5b3f69
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Les Lee
2022-08-29 02:02:41 +00:00
committed by Automerger Merge Worker
4 changed files with 10 additions and 0 deletions

View File

@@ -251,6 +251,9 @@ public class AllInOneTetherSettings extends RestrictedDashboardFragment
} }
final Context context = getContext(); final Context context = getContext();
if (context != null) { if (context != null) {
// The intent WIFI_AP_STATE_CHANGED_ACTION is not sticky intent after SC-V2
// But ACTION_TETHER_STATE_CHANGED is still sticky intent. So no need to handle
// initial state for WIFI_AP_STATE_CHANGED_ACTION
IntentFilter filter = new IntentFilter(ACTION_TETHER_STATE_CHANGED); IntentFilter filter = new IntentFilter(ACTION_TETHER_STATE_CHANGED);
filter.addAction(WIFI_AP_STATE_CHANGED_ACTION); filter.addAction(WIFI_AP_STATE_CHANGED_ACTION);
context.registerReceiver(mTetherChangeReceiver, filter); context.registerReceiver(mTetherChangeReceiver, filter);

View File

@@ -106,6 +106,9 @@ public class HotspotConditionController implements ConditionalCardController {
@Override @Override
public void startMonitoringStateChange() { public void startMonitoringStateChange() {
mAppContext.registerReceiver(mReceiver, WIFI_AP_STATE_FILTER); mAppContext.registerReceiver(mReceiver, WIFI_AP_STATE_FILTER);
// The intent WIFI_AP_STATE_CHANGED_ACTION is not sticky intent anymore after SC-V2
// Handle the initial state after register the receiver.
mConditionManager.onConditionChanged();
} }
@Override @Override

View File

@@ -161,6 +161,9 @@ public class WifiTetherSettings extends RestrictedDashboardFragment
if (context != null) { if (context != null) {
context.registerReceiver(mTetherChangeReceiver, TETHER_STATE_CHANGE_FILTER, context.registerReceiver(mTetherChangeReceiver, TETHER_STATE_CHANGE_FILTER,
Context.RECEIVER_EXPORTED_UNAUDITED); Context.RECEIVER_EXPORTED_UNAUDITED);
// The intent WIFI_AP_STATE_CHANGED_ACTION is not sticky intent anymore after SC-V2
// Handle the initial state after register the receiver.
updateDisplayWithNewConfig();
} }
} }

View File

@@ -93,6 +93,7 @@ public class WifiTetherSwitchBarController implements
mSwitchBar.addOnSwitchChangeListener(this); mSwitchBar.addOnSwitchChangeListener(this);
mContext.registerReceiver(mReceiver, WIFI_INTENT_FILTER, mContext.registerReceiver(mReceiver, WIFI_INTENT_FILTER,
Context.RECEIVER_EXPORTED_UNAUDITED); Context.RECEIVER_EXPORTED_UNAUDITED);
handleWifiApStateChanged(mWifiManager.getWifiApState());
} }
@Override @Override