summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiServiceImpl.java20
-rw-r--r--service/res/values/config.xml10
-rw-r--r--service/res/values/overlayable.xml1
3 files changed, 23 insertions, 8 deletions
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 @@
<!-- Wifi driver supports 6GHz band for softap -->
<bool translatable="false" name="config_wifiSoftap6ghzSupported">false</bool>
- <!-- Indicates that local-only hotspot should be brought up at 5GHz. This option is
- for automotive builds only (the one that have PackageManager#FEATURE_AUTOMOTIVE) -->
+ <!-- Indicates that local-only hotspot should be brought up at 6GHz if possible.
+ This option is for automotive builds only (the one that have
+ PackageManager#FEATURE_AUTOMOTIVE) -->
+ <bool translatable="false" name="config_wifiLocalOnlyHotspot6ghz">false</bool>
+
+ <!-- Indicates that local-only hotspot should be brought up at 5GHz if 6GHz is not enabled
+ or feasible. This option is for automotive builds only (the one that have
+ PackageManager#FEATURE_AUTOMOTIVE) -->
<bool translatable="false" name="config_wifi_local_only_hotspot_5ghz">false</bool>
<!-- Indicates that connected MAC randomization is supported on this device -->
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 @@
<item type="bool" name="config_wifiSoftapHeSuBeamformeeSupported" />
<item type="bool" name="config_wifiSoftapHeMuBeamformerSupported" />
<item type="bool" name="config_wifiSoftapHeTwtSupported" />
+ <item type="bool" name="config_wifiLocalOnlyHotspot6ghz" />
<item type="bool" name="config_wifi_local_only_hotspot_5ghz" />
<item type="bool" name="config_wifi_connected_mac_randomization_supported" />
<item type="bool" name="config_wifi_p2p_mac_randomization_supported" />