diff options
author | Ahmed ElArabawy | 2018-03-27 19:20:44 -0500 |
---|---|---|
committer | android-build-merger | 2018-03-27 19:20:44 -0500 |
commit | 8e9e886bc596f1013f7292b1afd38dd60ae14fbe (patch) | |
tree | 3f38272bd765e596641623502dd82e6cbc2c9ae2 /wifi | |
parent | ee7e016f5fbab31178e2d89e89b0cc04e97150b7 (diff) | |
parent | ef8890b691f05aea14642500b47f16430ce4a869 (diff) | |
download | platform-hardware-interfaces-8e9e886bc596f1013f7292b1afd38dd60ae14fbe.tar.gz platform-hardware-interfaces-8e9e886bc596f1013f7292b1afd38dd60ae14fbe.tar.xz platform-hardware-interfaces-8e9e886bc596f1013f7292b1afd38dd60ae14fbe.zip |
Merge changes from topic "propagate_eap_failure" into pi-dev
am: ef8890b691
Change-Id: Icf2d46c44b5de42a2526d0f8a1b05bc8371573ba
Diffstat (limited to 'wifi')
7 files changed, 244 insertions, 0 deletions
diff --git a/wifi/supplicant/1.1/Android.bp b/wifi/supplicant/1.1/Android.bp index fafd6ad4..832d1ad1 100644 --- a/wifi/supplicant/1.1/Android.bp +++ b/wifi/supplicant/1.1/Android.bp | |||
@@ -8,6 +8,8 @@ hidl_interface { | |||
8 | }, | 8 | }, |
9 | srcs: [ | 9 | srcs: [ |
10 | "ISupplicant.hal", | 10 | "ISupplicant.hal", |
11 | "ISupplicantStaIface.hal", | ||
12 | "ISupplicantStaIfaceCallback.hal", | ||
11 | "ISupplicantStaNetwork.hal", | 13 | "ISupplicantStaNetwork.hal", |
12 | ], | 14 | ], |
13 | interfaces: [ | 15 | interfaces: [ |
diff --git a/wifi/supplicant/1.1/ISupplicantStaIface.hal b/wifi/supplicant/1.1/ISupplicantStaIface.hal new file mode 100644 index 00000000..025cc6ab --- /dev/null +++ b/wifi/supplicant/1.1/ISupplicantStaIface.hal | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * Copyright 2018 The Android Open Source Project | ||
3 | * | ||
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | * you may not use this file except in compliance with the License. | ||
6 | * You may obtain a copy of the License at | ||
7 | * | ||
8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | * | ||
10 | * Unless required by applicable law or agreed to in writing, software | ||
11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | * See the License for the specific language governing permissions and | ||
14 | * limitations under the License. | ||
15 | */ | ||
16 | |||
17 | package android.hardware.wifi.supplicant@1.1; | ||
18 | |||
19 | import @1.0::ISupplicantStaIface; | ||
20 | import @1.1::ISupplicantStaIfaceCallback; | ||
21 | import @1.0::SupplicantStatus; | ||
22 | |||
23 | /** | ||
24 | * Interface exposed by the supplicant for each station mode network | ||
25 | * interface (e.g wlan0) it controls. | ||
26 | */ | ||
27 | interface ISupplicantStaIface extends @1.0::ISupplicantStaIface { | ||
28 | |||
29 | /** | ||
30 | * Register for callbacks from this interface. | ||
31 | * | ||
32 | * These callbacks are invoked for events that are specific to this interface. | ||
33 | * Registration of multiple callback objects is supported. These objects must | ||
34 | * be automatically deleted when the corresponding client process is dead or | ||
35 | * if this interface is removed. | ||
36 | * | ||
37 | * @param callback An instance of the |ISupplicantStaIfaceCallback| HIDL | ||
38 | * interface object. | ||
39 | * @return status Status of the operation. | ||
40 | * Possible status codes: | ||
41 | * |SupplicantStatusCode.SUCCESS|, | ||
42 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, | ||
43 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID| | ||
44 | */ | ||
45 | registerCallback_1_1(ISupplicantStaIfaceCallback callback) | ||
46 | generates (SupplicantStatus status); | ||
47 | }; | ||
48 | |||
diff --git a/wifi/supplicant/1.1/ISupplicantStaIfaceCallback.hal b/wifi/supplicant/1.1/ISupplicantStaIfaceCallback.hal new file mode 100644 index 00000000..8b92ee5e --- /dev/null +++ b/wifi/supplicant/1.1/ISupplicantStaIfaceCallback.hal | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright 2018 The Android Open Source Project | ||
3 | * | ||
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | * you may not use this file except in compliance with the License. | ||
6 | * You may obtain a copy of the License at | ||
7 | * | ||
8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | * | ||
10 | * Unless required by applicable law or agreed to in writing, software | ||
11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | * See the License for the specific language governing permissions and | ||
14 | * limitations under the License. | ||
15 | */ | ||
16 | |||
17 | package android.hardware.wifi.supplicant@1.1; | ||
18 | |||
19 | import @1.0::ISupplicantStaIfaceCallback; | ||
20 | |||
21 | /** | ||
22 | * Callback Interface exposed by the supplicant service | ||
23 | * for each station mode interface (ISupplicantStaIface). | ||
24 | * | ||
25 | * Clients need to host an instance of this HIDL interface object and | ||
26 | * pass a reference of the object to the supplicant via the | ||
27 | * corresponding |ISupplicantStaIface.registerCallback_1_1| method. | ||
28 | */ | ||
29 | interface ISupplicantStaIfaceCallback extends @1.0::ISupplicantStaIfaceCallback { | ||
30 | |||
31 | /* EapErrorCode: Error code for EAP or EAP Method as per RFC-4186 */ | ||
32 | enum EapErrorCode : uint32_t { | ||
33 | SIM_GENERAL_FAILURE_AFTER_AUTH = 0, | ||
34 | SIM_TEMPORARILY_DENIED = 1026, | ||
35 | SIM_NOT_SUBSCRIBED = 1031, | ||
36 | SIM_GENERAL_FAILURE_BEFORE_AUTH = 16384, | ||
37 | SIM_VENDOR_SPECIFIC_EXPIRED_CERT = 16385, | ||
38 | }; | ||
39 | |||
40 | /** | ||
41 | * Used to indicate an EAP authentication failure. | ||
42 | */ | ||
43 | oneway onEapFailure_1_1(EapErrorCode errorCode); | ||
44 | }; | ||
45 | |||
diff --git a/wifi/supplicant/1.1/vts/functional/Android.bp b/wifi/supplicant/1.1/vts/functional/Android.bp index 3efe15d7..3e65453c 100644 --- a/wifi/supplicant/1.1/vts/functional/Android.bp +++ b/wifi/supplicant/1.1/vts/functional/Android.bp | |||
@@ -40,6 +40,7 @@ cc_test { | |||
40 | srcs: [ | 40 | srcs: [ |
41 | "VtsHalWifiSupplicantV1_1TargetTest.cpp", | 41 | "VtsHalWifiSupplicantV1_1TargetTest.cpp", |
42 | "supplicant_hidl_test.cpp", | 42 | "supplicant_hidl_test.cpp", |
43 | "supplicant_sta_iface_hidl_test.cpp", | ||
43 | "supplicant_sta_network_hidl_test.cpp", | 44 | "supplicant_sta_network_hidl_test.cpp", |
44 | ], | 45 | ], |
45 | static_libs: [ | 46 | static_libs: [ |
diff --git a/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.cpp b/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.cpp index 3f177404..04a5ed9d 100644 --- a/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.cpp +++ b/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.cpp | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "supplicant_hidl_test_utils_1_1.h" | 21 | #include "supplicant_hidl_test_utils_1_1.h" |
22 | 22 | ||
23 | using ::android::hardware::wifi::supplicant::V1_1::ISupplicant; | 23 | using ::android::hardware::wifi::supplicant::V1_1::ISupplicant; |
24 | using ::android::hardware::wifi::supplicant::V1_1::ISupplicantStaIface; | ||
24 | using ::android::hardware::wifi::supplicant::V1_1::ISupplicantStaNetwork; | 25 | using ::android::hardware::wifi::supplicant::V1_1::ISupplicantStaNetwork; |
25 | using ::android::sp; | 26 | using ::android::sp; |
26 | 27 | ||
@@ -28,6 +29,10 @@ sp<ISupplicant> getSupplicant_1_1() { | |||
28 | return ISupplicant::castFrom(getSupplicant()); | 29 | return ISupplicant::castFrom(getSupplicant()); |
29 | } | 30 | } |
30 | 31 | ||
32 | sp<ISupplicantStaIface> getSupplicantStaIface_1_1() { | ||
33 | return ISupplicantStaIface::castFrom(getSupplicantStaIface()); | ||
34 | } | ||
35 | |||
31 | sp<ISupplicantStaNetwork> createSupplicantStaNetwork_1_1() { | 36 | sp<ISupplicantStaNetwork> createSupplicantStaNetwork_1_1() { |
32 | return ISupplicantStaNetwork::castFrom(createSupplicantStaNetwork()); | 37 | return ISupplicantStaNetwork::castFrom(createSupplicantStaNetwork()); |
33 | } | 38 | } |
diff --git a/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.h b/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.h index e7ce54ae..1c13325f 100644 --- a/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.h +++ b/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.h | |||
@@ -18,11 +18,15 @@ | |||
18 | #define SUPPLICANT_HIDL_TEST_UTILS_1_1_H | 18 | #define SUPPLICANT_HIDL_TEST_UTILS_1_1_H |
19 | 19 | ||
20 | #include <android/hardware/wifi/supplicant/1.1/ISupplicant.h> | 20 | #include <android/hardware/wifi/supplicant/1.1/ISupplicant.h> |
21 | #include <android/hardware/wifi/supplicant/1.1/ISupplicantStaIface.h> | ||
21 | #include <android/hardware/wifi/supplicant/1.1/ISupplicantStaNetwork.h> | 22 | #include <android/hardware/wifi/supplicant/1.1/ISupplicantStaNetwork.h> |
22 | 23 | ||
23 | android::sp<android::hardware::wifi::supplicant::V1_1::ISupplicant> | 24 | android::sp<android::hardware::wifi::supplicant::V1_1::ISupplicant> |
24 | getSupplicant_1_1(); | 25 | getSupplicant_1_1(); |
25 | 26 | ||
27 | android::sp<android::hardware::wifi::supplicant::V1_1::ISupplicantStaIface> | ||
28 | getSupplicantStaIface_1_1(); | ||
29 | |||
26 | android::sp<android::hardware::wifi::supplicant::V1_1::ISupplicantStaNetwork> | 30 | android::sp<android::hardware::wifi::supplicant::V1_1::ISupplicantStaNetwork> |
27 | createSupplicantStaNetwork_1_1(); | 31 | createSupplicantStaNetwork_1_1(); |
28 | 32 | ||
diff --git a/wifi/supplicant/1.1/vts/functional/supplicant_sta_iface_hidl_test.cpp b/wifi/supplicant/1.1/vts/functional/supplicant_sta_iface_hidl_test.cpp new file mode 100644 index 00000000..c5e6319d --- /dev/null +++ b/wifi/supplicant/1.1/vts/functional/supplicant_sta_iface_hidl_test.cpp | |||
@@ -0,0 +1,139 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2018 The Android Open Source Project | ||
3 | * | ||
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | * you may not use this file except in compliance with the License. | ||
6 | * You may obtain a copy of the License at | ||
7 | * | ||
8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | * | ||
10 | * Unless required by applicable law or agreed to in writing, software | ||
11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | * See the License for the specific language governing permissions and | ||
14 | * limitations under the License. | ||
15 | */ | ||
16 | |||
17 | #include <android-base/logging.h> | ||
18 | |||
19 | #include <VtsHalHidlTargetTestBase.h> | ||
20 | |||
21 | #include <android/hardware/wifi/supplicant/1.1/ISupplicantStaIface.h> | ||
22 | |||
23 | #include "supplicant_hidl_test_utils.h" | ||
24 | #include "supplicant_hidl_test_utils_1_1.h" | ||
25 | |||
26 | using ::android::sp; | ||
27 | using ::android::hardware::hidl_array; | ||
28 | using ::android::hardware::hidl_string; | ||
29 | using ::android::hardware::hidl_vec; | ||
30 | using ::android::hardware::Return; | ||
31 | using ::android::hardware::Void; | ||
32 | using ::android::hardware::wifi::supplicant::V1_1::ISupplicantStaIface; | ||
33 | using ::android::hardware::wifi::supplicant::V1_1::ISupplicantStaIfaceCallback; | ||
34 | using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatus; | ||
35 | using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatusCode; | ||
36 | |||
37 | class SupplicantStaIfaceHidlTest | ||
38 | : public ::testing::VtsHalHidlTargetTestBase { | ||
39 | public: | ||
40 | virtual void SetUp() override { | ||
41 | startSupplicantAndWaitForHidlService(); | ||
42 | EXPECT_TRUE(turnOnExcessiveLogging()); | ||
43 | sta_iface_ = getSupplicantStaIface_1_1(); | ||
44 | ASSERT_NE(sta_iface_.get(), nullptr); | ||
45 | } | ||
46 | |||
47 | virtual void TearDown() override { stopSupplicant(); } | ||
48 | |||
49 | protected: | ||
50 | // ISupplicantStaIface object used for all tests in this fixture. | ||
51 | sp<ISupplicantStaIface> sta_iface_; | ||
52 | }; | ||
53 | |||
54 | class IfaceCallback : public ISupplicantStaIfaceCallback { | ||
55 | Return<void> onNetworkAdded(uint32_t /* id */) override { return Void(); } | ||
56 | Return<void> onNetworkRemoved(uint32_t /* id */) override { return Void(); } | ||
57 | Return<void> onStateChanged( | ||
58 | ISupplicantStaIfaceCallback::State /* newState */, | ||
59 | const hidl_array<uint8_t, 6>& /*bssid */, uint32_t /* id */, | ||
60 | const hidl_vec<uint8_t>& /* ssid */) override { | ||
61 | return Void(); | ||
62 | } | ||
63 | Return<void> onAnqpQueryDone( | ||
64 | const hidl_array<uint8_t, 6>& /* bssid */, | ||
65 | const ISupplicantStaIfaceCallback::AnqpData& /* data */, | ||
66 | const ISupplicantStaIfaceCallback::Hs20AnqpData& /* hs20Data */) | ||
67 | override { | ||
68 | return Void(); | ||
69 | } | ||
70 | virtual Return<void> onHs20IconQueryDone( | ||
71 | const hidl_array<uint8_t, 6>& /* bssid */, | ||
72 | const hidl_string& /* fileName */, | ||
73 | const hidl_vec<uint8_t>& /* data */) override { | ||
74 | return Void(); | ||
75 | } | ||
76 | virtual Return<void> onHs20SubscriptionRemediation( | ||
77 | const hidl_array<uint8_t, 6>& /* bssid */, | ||
78 | ISupplicantStaIfaceCallback::OsuMethod /* osuMethod */, | ||
79 | const hidl_string& /* url*/) override { | ||
80 | return Void(); | ||
81 | } | ||
82 | Return<void> onHs20DeauthImminentNotice( | ||
83 | const hidl_array<uint8_t, 6>& /* bssid */, uint32_t /* reasonCode */, | ||
84 | uint32_t /* reAuthDelayInSec */, | ||
85 | const hidl_string& /* url */) override { | ||
86 | return Void(); | ||
87 | } | ||
88 | Return<void> onDisconnected(const hidl_array<uint8_t, 6>& /* bssid */, | ||
89 | bool /* locallyGenerated */, | ||
90 | ISupplicantStaIfaceCallback::ReasonCode | ||
91 | /* reasonCode */) override { | ||
92 | return Void(); | ||
93 | } | ||
94 | Return<void> onAssociationRejected( | ||
95 | const hidl_array<uint8_t, 6>& /* bssid */, | ||
96 | ISupplicantStaIfaceCallback::StatusCode /* statusCode */, | ||
97 | bool /*timedOut */) override { | ||
98 | return Void(); | ||
99 | } | ||
100 | Return<void> onAuthenticationTimeout( | ||
101 | const hidl_array<uint8_t, 6>& /* bssid */) override { | ||
102 | return Void(); | ||
103 | } | ||
104 | Return<void> onBssidChanged( | ||
105 | ISupplicantStaIfaceCallback::BssidChangeReason /* reason */, | ||
106 | const hidl_array<uint8_t, 6>& /* bssid */) override { | ||
107 | return Void(); | ||
108 | } | ||
109 | Return<void> onEapFailure() override { return Void(); } | ||
110 | Return<void> onEapFailure_1_1( | ||
111 | ISupplicantStaIfaceCallback::EapErrorCode /* eapErrorCode */) override { | ||
112 | return Void(); | ||
113 | } | ||
114 | Return<void> onWpsEventSuccess() override { return Void(); } | ||
115 | Return<void> onWpsEventFail( | ||
116 | const hidl_array<uint8_t, 6>& /* bssid */, | ||
117 | ISupplicantStaIfaceCallback::WpsConfigError /* configError */, | ||
118 | ISupplicantStaIfaceCallback::WpsErrorIndication /* errorInd */) | ||
119 | override { | ||
120 | return Void(); | ||
121 | } | ||
122 | Return<void> onWpsEventPbcOverlap() override { return Void(); } | ||
123 | Return<void> onExtRadioWorkStart(uint32_t /* id */) override { | ||
124 | return Void(); | ||
125 | } | ||
126 | Return<void> onExtRadioWorkTimeout(uint32_t /* id*/) override { | ||
127 | return Void(); | ||
128 | } | ||
129 | }; | ||
130 | |||
131 | /* | ||
132 | * RegisterCallback_1_1 | ||
133 | */ | ||
134 | TEST_F(SupplicantStaIfaceHidlTest, RegisterCallback_1_1) { | ||
135 | sta_iface_->registerCallback_1_1( | ||
136 | new IfaceCallback(), [](const SupplicantStatus& status) { | ||
137 | EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code); | ||
138 | }); | ||
139 | } | ||