Show Hotspot informations in Network details settings

- Show Hotspot device type in hearder icon

- Show Hotspot device details informations.
  - Internet source (network type)
  - Battery

Bug: 297346368
Test: manual test
atest -c WifiNetworkDetailsFragmentTest \
         WifiDetailPreferenceController2Test
atest -c SharedConnectivityRepositoryTest \
         WifiNetworkDetailsViewModelTest

Change-Id: I4bd090e00681911c8fac469289fd818237b8c518
This commit is contained in:
Weng Su
2023-08-29 01:48:54 +08:00
parent 84c4ec936a
commit 25e20caf00
10 changed files with 721 additions and 45 deletions

View File

@@ -58,8 +58,7 @@ public class SharedConnectivityRepository {
MutableLiveData<SharedConnectivitySettingsState> mSettingsState = new MutableLiveData<>();
public SharedConnectivityRepository(@NonNull Context appContext) {
this(appContext,
DeviceConfig.getBoolean(DEVICE_CONFIG_NAMESPACE, DEVICE_CONFIG_KEY, false));
this(appContext, isDeviceConfigEnabled());
}
@VisibleForTesting
@@ -181,4 +180,11 @@ public class SharedConnectivityRepository {
private void log(String msg) {
FeatureFactory.getFeatureFactory().getWifiFeatureProvider().verboseLog(TAG, msg);
}
/**
* Returns true if Shared Connectivity feature is enabled.
*/
public static boolean isDeviceConfigEnabled() {
return DeviceConfig.getBoolean(DEVICE_CONFIG_NAMESPACE, DEVICE_CONFIG_KEY, false);
}
}