diff options
author | Glen Kuhne <kuh@google.com> | 2017-05-10 16:22:44 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-05-10 16:22:45 +0000 |
commit | 24c6c561641948da3315f9f8124fc960b65a70a8 (patch) | |
tree | f90cf4bad4c32cee12fc4b84cbc20a3bde2d8af1 /service | |
parent | e64cc58a5ba045a3e6b81994614e2b0a95c7add4 (diff) | |
parent | 5a843c0d793abf48de2c77e0b1a54fded88bb018 (diff) |
Merge "Fix P2P provision discovery config method" into oc-dev
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceCallback.java | 11 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceHal.java | 9 |
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."); |