Merge "[Provider Model] Carrie Wi-Fi offload toggle request (panel)" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-04-21 08:19:23 +00:00
committed by Android (Google) Code Review
4 changed files with 46 additions and 62 deletions

View File

@@ -182,18 +182,18 @@ public class ProviderModelSlice extends WifiSlice {
final boolean isDataEnabled =
isToggleAction ? newState : MobileNetworkUtils.isMobileDataEnabled(mContext);
doCarrierNetworkAction(isToggleAction, isDataEnabled);
doCarrierNetworkAction(isToggleAction, isDataEnabled, defaultSubId);
}
@VisibleForTesting
void doCarrierNetworkAction(boolean isToggleAction, boolean isDataEnabled) {
void doCarrierNetworkAction(boolean isToggleAction, boolean isDataEnabled, int subId) {
final NetworkProviderWorker worker = getWorker();
if (worker == null) {
return;
}
if (isToggleAction) {
worker.setCarrierNetworkEnabled(isDataEnabled);
worker.setCarrierNetworkEnabledIfNeeded(isDataEnabled, subId);
return;
}