Adds soft AP timeout settings

Adds two different settings for this feature: 1) to enable/disable
the timeout mechanism (by a toggle control from Settings UI). 2) to set
the timeout duration which is configurable as an overlay.

Bug: 68712445
Test: None
Change-Id: I6232410f85b9c25477d3edada37cc7312d888f19
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 1427f8c2..c4c6798 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -8651,6 +8651,12 @@
                 "wifi_scan_always_enabled";
 
         /**
+         * Whether soft AP will shut down after a timeout period when no devices are connected.
+         * @hide
+         */
+        public static final String SOFT_AP_TIMEOUT_ENABLED = "soft_ap_timeout_enabled";
+
+        /**
          * Value to specify if Wi-Fi Wakeup feature is enabled.
          *
          * Type: int (0 for false, 1 for true)
@@ -10493,7 +10499,8 @@
             LOW_POWER_MODE_TRIGGER_LEVEL,
             BLUETOOTH_ON,
             PRIVATE_DNS_MODE,
-            PRIVATE_DNS_SPECIFIER
+            PRIVATE_DNS_SPECIFIER,
+            SOFT_AP_TIMEOUT_ENABLED
         };
 
         /** @hide */
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 5f756fa..fc64918 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -565,6 +565,12 @@
     <integer translatable="false" name="config_wifi_framework_wifi_score_good_link_speed_24">24</integer>
     <integer translatable="false" name="config_wifi_framework_wifi_score_good_link_speed_5">36</integer>
 
+    <!-- Integer delay in milliseconds before shutting down soft AP when there
+         are no connected devices. Framework will enforce a minimum limit on
+         this value and this setting will be overridden if the provided value is
+         smaller than the limit. -->
+    <integer translatable="false" name="config_wifi_framework_soft_ap_timeout_delay">600000</integer>
+
     <string  translatable="false" name="config_wifi_random_mac_oui">DA-A1-19</string>
     <string  translatable="false" name="config_wifi_framework_sap_2G_channel_list">1,6,11</string>
 
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index ad947b7..b46057d 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -391,6 +391,8 @@
   <java-symbol type="integer" name="config_wifi_framework_min_tx_rate_for_staying_on_network" />
   <java-symbol type="integer" name="config_wifi_framework_min_rx_rate_for_staying_on_network" />
 
+  <java-symbol type="integer" name="config_wifi_framework_soft_ap_timeout_delay" />
+
   <java-symbol type="bool" name="config_wifi_framework_cellular_handover_enable_user_triggered_adjustment" />
   <java-symbol type="integer" name="config_wifi_framework_associated_full_scan_tx_packet_threshold" />
   <java-symbol type="integer" name="config_wifi_framework_associated_full_scan_rx_packet_threshold" />