export API to disable autojoin scan initial implementation

Change-Id: I504f135ab91c5e483a92306a9b96d70b80f11362
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java
index cc5824e..36e83e6 100644
--- a/service/java/com/android/server/wifi/WifiServiceImpl.java
+++ b/service/java/com/android/server/wifi/WifiServiceImpl.java
@@ -1840,6 +1840,16 @@
         return mWifiStateMachine.getAllowScansWithTraffic();
     }
 
+    public void setAllowScansWhileAssociated(boolean enabled) {
+        enforceAccessPermission();
+        mWifiStateMachine.setAllowScansWhileAssociated(enabled);
+    }
+
+    public boolean getAllowScansWhileAssociated() {
+        enforceAccessPermission();
+        return mWifiStateMachine.getAllowScansWhileAssociated();
+    }
+
     /* Return the Wifi Connection statistics object */
     public WifiConnectionStatistics getConnectionStatistics() {
         enforceAccessPermission();
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java
index 7c65f3a..d122785 100644
--- a/service/java/com/android/server/wifi/WifiStateMachine.java
+++ b/service/java/com/android/server/wifi/WifiStateMachine.java
@@ -1124,6 +1124,14 @@
         return mWifiConfigStore.alwaysEnableScansWhileAssociated;
     }
 
+    public void setAllowScansWhileAssociated(boolean enabled) {
+        mWifiConfigStore.enableAutoJoinScanWhenAssociated = enabled;
+    }
+
+    public boolean getAllowScansWhileAssociated() {
+        return mWifiConfigStore.enableAutoJoinScanWhenAssociated;
+    }
+
     /*
      *
      * Framework scan control