[Provider Model] Hide W+ network if it's inactive

Bug: 187854575
Test: manual test
atest -c CarrierWifiTogglePreferenceControllerTest \
         SubscriptionsPreferenceControllerTest

Change-Id: Ib99bc7fef38a99c1da1e365c2002ad30c617d445
This commit is contained in:
Weng Su
2021-06-11 17:05:21 +08:00
parent 9f7564c1b6
commit c4eb3b1320
6 changed files with 59 additions and 29 deletions

View File

@@ -77,7 +77,7 @@ public class WifiPickerTrackerHelper implements LifecycleObserver {
Process.THREAD_PRIORITY_BACKGROUND);
mWorkerThread.start();
mWifiPickerTracker = FeatureFactory.getFactory(context)
mWifiPickerTracker = FeatureFactory.getFactory(context)
.getWifiTrackerLibProvider()
.createWifiPickerTracker(lifecycle, context,
new Handler(Looper.getMainLooper()),
@@ -139,8 +139,8 @@ public class WifiPickerTrackerHelper implements LifecycleObserver {
return true;
}
/** Confirms connection of the carrier network */
public boolean isActiveCarrierNetwork() {
/** Confirms connection of the carrier network connected with the internet access */
public boolean isCarrierNetworkActive() {
final MergedCarrierEntry mergedCarrierEntry = mWifiPickerTracker.getMergedCarrierEntry();
if (mergedCarrierEntry != null) {
return mergedCarrierEntry.getConnectedState() == WifiEntry.CONNECTED_STATE_CONNECTED