summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceCallback.java11
-rw-r--r--service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceHal.java9
2 files changed, 17 insertions, 3 deletions
diff --git a/service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceCallback.java b/service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceCallback.java
index 5f4cb1773..1d106c066 100644
--- a/service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceCallback.java
+++ b/service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceCallback.java
@@ -413,11 +413,18 @@ public class SupplicantP2pIfaceCallback extends ISupplicantP2pIfaceCallback.Stub
event.event = WifiP2pProvDiscEvent.PBC_RSP;
mMonitor.broadcastP2pProvisionDiscoveryPbcResponse(mInterface, event);
}
- } else if ((configMethods & WpsConfigMethods.DISPLAY) != 0) {
+ } else if (!isRequest && (configMethods & WpsConfigMethods.KEYPAD) != 0) {
event.event = WifiP2pProvDiscEvent.SHOW_PIN;
event.pin = generatedPin;
mMonitor.broadcastP2pProvisionDiscoveryShowPin(mInterface, event);
- } else if ((configMethods & WpsConfigMethods.KEYPAD) != 0) {
+ } else if (!isRequest && (configMethods & WpsConfigMethods.DISPLAY) != 0) {
+ event.event = WifiP2pProvDiscEvent.ENTER_PIN;
+ mMonitor.broadcastP2pProvisionDiscoveryEnterPin(mInterface, event);
+ } else if (isRequest && (configMethods & WpsConfigMethods.DISPLAY) != 0) {
+ event.event = WifiP2pProvDiscEvent.SHOW_PIN;
+ event.pin = generatedPin;
+ mMonitor.broadcastP2pProvisionDiscoveryShowPin(mInterface, event);
+ } else if (isRequest && (configMethods & WpsConfigMethods.KEYPAD) != 0) {
event.event = WifiP2pProvDiscEvent.ENTER_PIN;
mMonitor.broadcastP2pProvisionDiscoveryEnterPin(mInterface, event);
} else {
diff --git a/service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceHal.java b/service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceHal.java
index fe91b27d4..98b268f73 100644
--- a/service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceHal.java
+++ b/service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceHal.java
@@ -729,10 +729,17 @@ public class SupplicantP2pIfaceHal {
if (!checkSupplicantP2pIfaceAndLogFailure("provisionDiscovery")) return false;
int targetMethod = wpsInfoToConfigMethod(config.wps.setup);
- if (targetMethod == -1) {
+ if (targetMethod == RESULT_NOT_VALID) {
Log.e(TAG, "Unrecognized WPS configuration method: " + config.wps.setup);
return false;
}
+ if (targetMethod == ISupplicantP2pIface.WpsProvisionMethod.DISPLAY) {
+ // We are doing display, so provision discovery is keypad.
+ targetMethod = ISupplicantP2pIface.WpsProvisionMethod.KEYPAD;
+ } else if (targetMethod == ISupplicantP2pIface.WpsProvisionMethod.KEYPAD) {
+ // We are doing keypad, so provision discovery is display.
+ targetMethod = ISupplicantP2pIface.WpsProvisionMethod.DISPLAY;
+ }
if (config.deviceAddress == null) {
Log.e(TAG, "Cannot parse null mac address.");