[Provider Model] Adjust slice title and subtitle

- Show "Airplane mode" title when airplane mode is enabled

- Remove "Airplane mode is on" subtitle

- Show "Wi-Fi is turned on" subtitle when both airplane mode and Wi-Fi
is enabled

- Remove the function related to isApmNetworksAvailable()

- Screenshot:
  https://screenshot.googleplex.com/6X9nzmXRCUfw4Lp
  https://screenshot.googleplex.com/6jQryMjU2yDDpmM

Bug: 181858434
Test: manual test
atest -c InternetConnectivityPanelTest \
         InternetPreferenceControllerTest \
         InternetUpdaterTest

Change-Id: I84e5d4c60ed91d58443b27c35286a84bf72ac173
This commit is contained in:
Weng Su
2021-03-10 22:28:26 +08:00
parent 38e19abdf7
commit 6a0ef56917
5 changed files with 118 additions and 102 deletions

View File

@@ -73,9 +73,9 @@ public class InternetUpdater implements AirplaneModeEnabler.OnAirplaneModeChange
default void onAirplaneModeChanged(boolean isAirplaneModeOn) {};
/**
* Called when airplane mode networks state is changed.
* Called when Wi-Fi enabled is changed.
*/
default void onAirplaneModeNetworksChanged(boolean available) {};
default void onWifiEnabledChanged(boolean enabled) {};
}
/**
@@ -157,9 +157,8 @@ public class InternetUpdater implements AirplaneModeEnabler.OnAirplaneModeChange
@Override
public void onReceive(Context context, Intent intent) {
fetchActiveNetwork();
if (mListener != null && mAirplaneModeEnabler.isAirplaneModeOn()) {
mListener.onAirplaneModeNetworksChanged(
mWifiManager.getWifiState() == WifiManager.WIFI_STATE_ENABLED);
if (mListener != null) {
mListener.onWifiEnabledChanged(mWifiManager.isWifiEnabled());
}
}
};
@@ -272,10 +271,9 @@ public class InternetUpdater implements AirplaneModeEnabler.OnAirplaneModeChange
}
/**
* Return ture when the APM networks is available.
* Return ture when the Wi-Fi is enabled.
*/
public boolean isApmNetworksAvailable() {
return mAirplaneModeEnabler.isAirplaneModeOn()
&& (mWifiManager.getWifiState() == WifiManager.WIFI_STATE_ENABLED);
public boolean isWifiEnabled() {
return mWifiManager.isWifiEnabled();
}
}