Soft-Ap: Add API to enable Beacon Protection and OCV

This commit adds following platform APIs to support Beacon Protection
and OCV feature:
 - isSoftApBeaconProtectionFeatureEnabled(): To check if Beacon Protection
   is enabled
 - isSoftApBeaconProtectionFeatureSupported(): To check if Beacon Protection
   is supported
 - enableSoftApBeaconProtectionFeature(boolean):To enable/disable Beacon
   Protection
 - isSoftApOcvFeatureEnabled(): To check if OCV is enabled
 - isSoftApOcvFeatureSupported(): To check if OCV is supported
 - enableSoftApOcvFeature(boolean):To enable/disable OCV

Change-Id: I645b46dede35469765b38da0cf8e5fc19904af51
CRs-Fixed: 2735172
diff --git a/packages/SettingsLib/res/values/strings.xml b/packages/SettingsLib/res/values/strings.xml
index ddd296e..9a8af3d 100644
--- a/packages/SettingsLib/res/values/strings.xml
+++ b/packages/SettingsLib/res/values/strings.xml
@@ -654,6 +654,10 @@
     <string name="wifi_display_certification">Wireless display certification</string>
     <!-- Setting Checkbox title whether to enable WiFi coverage extending feature. -->
     <string name="wifi_coverage_extend">Enable Wi\u2011Fi Coverage Extend Feature</string>
+    <!-- Setting Checkbox title whether to enable SoftAp OCV Feature. -->
+    <string name="softap_ocv">Enable SoftAp OCV</string>
+    <!-- Setting Checkbox title whether to enable SoftAp Beacon Protection. -->
+    <string name="softap_beacon_protection">Enable SoftAp Beacon Protection</string>
     <!-- Setting Checkbox title whether to enable WiFi Verbose Logging. [CHAR LIMIT=40] -->
     <string name="wifi_verbose_logging">Enable Wi\u2011Fi Verbose Logging</string>
     <!-- Setting Checkbox title whether to disable WiFi Scan Throttling. [CHAR LIMIT=40] -->
@@ -729,6 +733,10 @@
     <!-- Setting Checkbox summary whether to enable Wifi verbose Logging [CHAR_LIMIT=NONE] -->
     <!-- Setting Checkbox summary whether to enable WiFi coverage extending feature. -->
     <string name="wifi_coverage_extend_summary">Enable extending Wi\u2011Fi coverage using Hotspot</string>
+    <!-- Setting Checkbox summary whether to enable SoftAp OCV. -->
+    <string name="softap_ocv_summary">Enable SoftAp OCV using Hotspot</string>
+    <!-- Setting Checkbox summary whether to enable SoftAp Beacon Protection. -->
+    <string name="softap_beacon_protection_summary">Enable SoftAp beacon protection using Hotspot</string>
     <!-- Setting Checkbox summary whether to enable Wifi verbose Logging [CHAR LIMIT=80] -->
     <string name="wifi_verbose_logging_summary">Increase Wi\u2011Fi logging level, show per SSID RSSI in Wi\u2011Fi Picker</string>
     <!-- Setting Checkbox summary whether to disable Wifi scan throttling [CHAR LIMIT=NONE] -->
diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl
index cf87ed4..1f9968c 100644
--- a/wifi/java/android/net/wifi/IWifiManager.aidl
+++ b/wifi/java/android/net/wifi/IWifiManager.aidl
@@ -241,6 +241,18 @@
 
     boolean isWifiCoverageExtendFeatureEnabled();
 
+    boolean isSoftApOcvFeatureEnabled();
+
+    boolean isSoftApBeaconProtFeatureEnabled();
+
+    boolean isSoftApOcvFeatureSupported();
+
+    boolean isSoftApBeaconProtFeatureSupported();
+
+    void enableSoftApOcvFeature(boolean enable);
+
+    void enableSoftApBeaconProtFeature(boolean enable);
+
     void enableWifiCoverageExtendFeature(boolean enable);
 
     void registerNetworkRequestMatchCallback(in IBinder binder, in INetworkRequestMatchCallback callback, int callbackIdentifier);
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index 6f7ca05..706a6cb 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -1746,6 +1746,92 @@
       }
 
     /**
+     * Check whether SoftAp OCV Feature is enabled
+     *
+     * @return true if SoftAp OCV is enabled.
+     *
+     * @hide no intent to publish
+     */
+     public boolean isSoftApOcvFeatureEnabled() {
+         try {
+             return mService.isSoftApOcvFeatureEnabled();
+         } catch (RemoteException e) {
+             throw e.rethrowFromSystemServer();
+         }
+     }
+
+    /**
+     * Check whether SoftAp OCV Feature is supported
+     *
+     * @return true if SoftAp OCV is supported.
+     *
+     * @hide no intent to publish
+     */
+     public boolean isSoftApOcvFeatureSupported() {
+         try {
+             return mService.isSoftApOcvFeatureSupported();
+         } catch (RemoteException e) {
+             throw e.rethrowFromSystemServer();
+         }
+     }
+
+    /**
+     * Enable/disable SoftAp OCV Feature.
+     *
+     * @hide no intent to publish
+     */
+     public void enableSoftApOcvFeature(boolean enable) {
+         try {
+             mService.enableSoftApOcvFeature(enable);
+         } catch (RemoteException e) {
+             throw e.rethrowFromSystemServer();
+         }
+     }
+
+    /**
+     * Check whether SoftAp Beacon Protection Feature is enabled
+     *
+     * @return true if SoftAp Beacon Protection Feature is enabled.
+     *
+     * @hide no intent to publish
+     */
+     public boolean isSoftApBeaconProtFeatureEnabled() {
+         try {
+             return mService.isSoftApBeaconProtFeatureEnabled();
+         } catch (RemoteException e) {
+             throw e.rethrowFromSystemServer();
+         }
+     }
+
+    /**
+     * Check whether SoftAp Beacon Protection Feature is supported
+     *
+     * @return true if SoftAp Beacon Protection Feature is supported.
+     *
+     * @hide no intent to publish
+     */
+     public boolean isSoftApBeaconProtFeatureSupported() {
+         try {
+             return mService.isSoftApBeaconProtFeatureSupported();
+         } catch (RemoteException e) {
+             throw e.rethrowFromSystemServer();
+         }
+     }
+
+    /**
+     * Enable/disable SoftAp Beacon Protection Feature.
+     *
+     * @hide no intent to publish
+     */
+     public void enableSoftApBeaconProtFeature(boolean enable) {
+         try {
+             mService.enableSoftApBeaconProtFeature(enable);
+         } catch (RemoteException e) {
+             throw e.rethrowFromSystemServer();
+         }
+     }
+
+    /**
      * Internal method for doing the RPC that creates a new network description
      * or updates an existing one.
      *