From 270deabd4c2f6e3f52e4c5bebca14c713cb26d5d Mon Sep 17 00:00:00 2001 From: Ahmed ElArabawy Date: Wed, 3 Jun 2020 15:57:34 -0700 Subject: Allow for LOHS to run in 6GHz for auto This commit adds an overlay for enabling LOHS on 6GHz for auto. The 6GHz band will be used only if enabled by this overlay, and if device supports 6GHz for softAp operation. Bug: 158126668 Test: atest FrameworksWifiTests Change-Id: I4e684826a5f2db5c5cf7ca4897dc7916f84e3795 Merged-In: I4e684826a5f2db5c5cf7ca4897dc7916f84e3795 --- .../com/android/server/wifi/WifiServiceImpl.java | 20 ++++++++++++++------ service/res/values/config.xml | 10 ++++++++-- service/res/values/overlayable.xml | 1 + 3 files changed, 23 insertions(+), 8 deletions(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index 9d12aa000..52fb61fdb 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -1448,12 +1448,20 @@ public class WifiServiceImpl extends BaseWifiService { @GuardedBy("mLocalOnlyHotspotRequests") private void startForFirstRequestLocked(LocalOnlyHotspotRequestInfo request) { - boolean is5Ghz = hasAutomotiveFeature(mContext) - && mContext.getResources().getBoolean( - R.bool.config_wifi_local_only_hotspot_5ghz) - && is5GhzBandSupportedInternal(); - - int band = is5Ghz ? SoftApConfiguration.BAND_5GHZ : SoftApConfiguration.BAND_2GHZ; + int band = SoftApConfiguration.BAND_2GHZ; + + // For auto only + if (hasAutomotiveFeature(mContext)) { + if (mContext.getResources().getBoolean(R.bool.config_wifiLocalOnlyHotspot6ghz) + && mContext.getResources().getBoolean(R.bool.config_wifiSoftap6ghzSupported) + && is6GhzBandSupportedInternal()) { + band = SoftApConfiguration.BAND_6GHZ; + } else if (mContext.getResources().getBoolean( + R.bool.config_wifi_local_only_hotspot_5ghz) + && is5GhzBandSupportedInternal()) { + band = SoftApConfiguration.BAND_5GHZ; + } + } SoftApConfiguration softApConfig = WifiApConfigStore.generateLocalOnlyHotspotConfig( mContext, band, request.getCustomConfig()); diff --git a/service/res/values/config.xml b/service/res/values/config.xml index 881373807..ad454c10a 100644 --- a/service/res/values/config.xml +++ b/service/res/values/config.xml @@ -217,8 +217,14 @@ false - + + false + + false diff --git a/service/res/values/overlayable.xml b/service/res/values/overlayable.xml index 7b77da512..cab5bbfb4 100644 --- a/service/res/values/overlayable.xml +++ b/service/res/values/overlayable.xml @@ -81,6 +81,7 @@ + -- cgit v1.2.3