Merge "Correct the defined value of Maximize compatibility" into sc-dev am: 4675222987

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/13981642

Change-Id: I09f264fb071f7af47c461bc19f246cc394c519a4
This commit is contained in:
Weng Su
2021-03-25 09:22:27 +00:00
committed by Automerger Merge Worker
2 changed files with 18 additions and 10 deletions

View File

@@ -86,7 +86,11 @@ public class WifiTetherMaximizeCompatibilityPreferenceController extends
if (mWifiManager.isBridgedApConcurrencySupported()) {
final boolean isEnabled = config.isBridgedModeOpportunisticShutdownEnabled();
Log.d(TAG, "isBridgedModeOpportunisticShutdownEnabled:" + isEnabled);
return isEnabled;
// Because the return value defined by the Wi-Fi framework API is opposite to the UI.
// Compatibility on: isBridgedModeOpportunisticShutdownEnabled() = false
// Compatibility off: isBridgedModeOpportunisticShutdownEnabled() = true
// Need to return the reverse value.
return !isEnabled;
}
// If the BridgedAp Concurrency is not supported in early Pixel devices (e.g. Pixel 2~5),
@@ -112,7 +116,11 @@ public class WifiTetherMaximizeCompatibilityPreferenceController extends
SoftApConfiguration.BAND_2GHZ | SoftApConfiguration.BAND_5GHZ};
builder.setBands(bands);
Log.d(TAG, "setBridgedModeOpportunisticShutdownEnabled:" + enabled);
builder.setBridgedModeOpportunisticShutdownEnabled(enabled);
// Because the defined value by the Wi-Fi framework API is opposite to the UI.
// Compatibility on: setBridgedModeOpportunisticShutdownEnabled(false)
// Compatibility off: setBridgedModeOpportunisticShutdownEnabled(true)
// Need to set the reverse value.
builder.setBridgedModeOpportunisticShutdownEnabled(!enabled);
} else {
int band = enabled
? SoftApConfiguration.BAND_2GHZ | SoftApConfiguration.BAND_5GHZ