Initialize p2p settings
And fix associated changes from the settings.
With p2p_reconnect setting turned on, it means the p2p group can be
started without a group negotiation. Hence, handle p2p group started in
the P2pEnabledState
Also, reinvocation results in supplicant not reporting device address correctly.
Handle that until supplicant fix is fixed.
Bug: 5002384
Change-Id: I335f6e854acd6839f54da9b460b17ad7505b1098
diff --git a/wifi/java/android/net/wifi/WifiNative.java b/wifi/java/android/net/wifi/WifiNative.java
index 8d327d0..2cd54d9 100644
--- a/wifi/java/android/net/wifi/WifiNative.java
+++ b/wifi/java/android/net/wifi/WifiNative.java
@@ -217,6 +217,19 @@
return doBooleanCommand("WPS_PIN any " + pin);
}
+ public static boolean setPersistentReconnect(boolean enabled) {
+ int value = (enabled == true) ? 1 : 0;
+ return WifiNative.doBooleanCommand("SET persistent_reconnect " + value);
+ }
+
+ public static boolean setDeviceName(String name) {
+ return WifiNative.doBooleanCommand("SET device_name " + name);
+ }
+
+ public static boolean setDeviceType(String type) {
+ return WifiNative.doBooleanCommand("SET device_type " + type);
+ }
+
public static boolean p2pFind() {
return doBooleanCommand("P2P_FIND");
}