[Provider Model] Dynamically update the Internet Panel title

- Change from "Internet" to "Airplane mode networks"

- Screenshot:
  https://screenshot.googleplex.com/gk3RBcjPsXq5NTk

Bug: 176803442
Test: manual test
- atest InternetConnectivityPanelTest
- make RunSettingsRoboTests ROBOTEST_FILTER=PanelFragmentTest

Change-Id: Ifb2c24434e480861fc7c3eaece683d49eb99013e
This commit is contained in:
Weng Su
2021-01-26 17:17:58 +08:00
parent ba845f7fe4
commit 28172b61c8
6 changed files with 181 additions and 7 deletions

View File

@@ -149,16 +149,15 @@ public class InternetUpdater implements AirplaneModeEnabler.OnAirplaneModeChange
public InternetUpdater(Context context, Lifecycle lifecycle,
OnInternetTypeChangedListener listener) {
if (lifecycle == null) {
throw new IllegalArgumentException("Lifecycle must be set");
}
mContext = context;
mAirplaneModeEnabler = new AirplaneModeEnabler(mContext, this);
mConnectivityManager = mContext.getSystemService(ConnectivityManager.class);
mWifiManager = mContext.getSystemService(WifiManager.class);
mWifiStateFilter = new IntentFilter(WifiManager.WIFI_STATE_CHANGED_ACTION);
mOnInternetTypeChangedListener = listener;
lifecycle.addObserver(this);
if (lifecycle != null) {
lifecycle.addObserver(this);
}
}
/** @OnLifecycleEvent(ON_RESUME) */