diff options
author | Ningyuan Wang | 2017-08-22 18:57:31 -0500 |
---|---|---|
committer | android-build-merger | 2017-08-22 18:57:31 -0500 |
commit | 03c0cf27ae318db90177f765823eee7bf7a6c5a8 (patch) | |
tree | 81919886ae94c17c2cfce0e59b157e1fa872ee94 | |
parent | f74f00f7f928e9617ae509e5eedab4e60aa9828d (diff) | |
parent | 7018247f52c2cf15d960b4b66bee7f1f75ff34ef (diff) | |
download | system-connectivity-wificond-03c0cf27ae318db90177f765823eee7bf7a6c5a8.tar.gz system-connectivity-wificond-03c0cf27ae318db90177f765823eee7bf7a6c5a8.tar.xz system-connectivity-wificond-03c0cf27ae318db90177f765823eee7bf7a6c5a8.zip |
Merge "Remove RTT related code from wificond" into oc-mr1-dev
am: 7018247f52
Change-Id: I66a110dbfdc0dcd8241d6d53d30dec7ee5b2dab0
-rw-r--r-- | Android.mk | 4 | ||||
-rw-r--r-- | aidl/android/net/wifi/IRttClient.aidl | 21 | ||||
-rw-r--r-- | aidl/android/net/wifi/IRttController.aidl | 21 | ||||
-rw-r--r-- | aidl/android/net/wifi/IWificond.aidl | 12 | ||||
-rw-r--r-- | rtt/rtt_controller_binder.cpp | 31 | ||||
-rw-r--r-- | rtt/rtt_controller_binder.h | 49 | ||||
-rw-r--r-- | rtt/rtt_controller_impl.cpp | 71 | ||||
-rw-r--r-- | rtt/rtt_controller_impl.h | 54 | ||||
-rw-r--r-- | server.cpp | 21 | ||||
-rw-r--r-- | server.h | 12 |
10 files changed, 0 insertions, 296 deletions
@@ -59,8 +59,6 @@ LOCAL_SRC_FILES := \ | |||
59 | client_interface_impl.cpp \ | 59 | client_interface_impl.cpp \ |
60 | logging_utils.cpp \ | 60 | logging_utils.cpp \ |
61 | looper_backed_event_loop.cpp \ | 61 | looper_backed_event_loop.cpp \ |
62 | rtt/rtt_controller_binder.cpp \ | ||
63 | rtt/rtt_controller_impl.cpp \ | ||
64 | scanning/channel_settings.cpp \ | 62 | scanning/channel_settings.cpp \ |
65 | scanning/hidden_network.cpp \ | 63 | scanning/hidden_network.cpp \ |
66 | scanning/offload_scan_callback_interface_impl.cpp \ | 64 | scanning/offload_scan_callback_interface_impl.cpp \ |
@@ -122,8 +120,6 @@ LOCAL_SRC_FILES := \ | |||
122 | aidl/android/net/wifi/IClientInterface.aidl \ | 120 | aidl/android/net/wifi/IClientInterface.aidl \ |
123 | aidl/android/net/wifi/IInterfaceEventCallback.aidl \ | 121 | aidl/android/net/wifi/IInterfaceEventCallback.aidl \ |
124 | aidl/android/net/wifi/IPnoScanEvent.aidl \ | 122 | aidl/android/net/wifi/IPnoScanEvent.aidl \ |
125 | aidl/android/net/wifi/IRttClient.aidl \ | ||
126 | aidl/android/net/wifi/IRttController.aidl \ | ||
127 | aidl/android/net/wifi/IScanEvent.aidl \ | 123 | aidl/android/net/wifi/IScanEvent.aidl \ |
128 | aidl/android/net/wifi/IWificond.aidl \ | 124 | aidl/android/net/wifi/IWificond.aidl \ |
129 | aidl/android/net/wifi/IWifiScannerImpl.aidl \ | 125 | aidl/android/net/wifi/IWifiScannerImpl.aidl \ |
diff --git a/aidl/android/net/wifi/IRttClient.aidl b/aidl/android/net/wifi/IRttClient.aidl deleted file mode 100644 index b58fdca..0000000 --- a/aidl/android/net/wifi/IRttClient.aidl +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 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.net.wifi; | ||
18 | |||
19 | interface IRttClient { | ||
20 | // TODO(nywang) add functions | ||
21 | } | ||
diff --git a/aidl/android/net/wifi/IRttController.aidl b/aidl/android/net/wifi/IRttController.aidl deleted file mode 100644 index 30f8d0d..0000000 --- a/aidl/android/net/wifi/IRttController.aidl +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 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.net.wifi; | ||
18 | |||
19 | interface IRttController { | ||
20 | // TODO(nywang) add functions | ||
21 | } | ||
diff --git a/aidl/android/net/wifi/IWificond.aidl b/aidl/android/net/wifi/IWificond.aidl index 48e2924..0b303ad 100644 --- a/aidl/android/net/wifi/IWificond.aidl +++ b/aidl/android/net/wifi/IWificond.aidl | |||
@@ -19,8 +19,6 @@ package android.net.wifi; | |||
19 | import android.net.wifi.IApInterface; | 19 | import android.net.wifi.IApInterface; |
20 | import android.net.wifi.IClientInterface; | 20 | import android.net.wifi.IClientInterface; |
21 | import android.net.wifi.IInterfaceEventCallback; | 21 | import android.net.wifi.IInterfaceEventCallback; |
22 | import android.net.wifi.IRttClient; | ||
23 | import android.net.wifi.IRttController; | ||
24 | 22 | ||
25 | // Service interface that exposes primitives for controlling the WiFi | 23 | // Service interface that exposes primitives for controlling the WiFi |
26 | // subsystems of a device. | 24 | // subsystems of a device. |
@@ -57,14 +55,4 @@ interface IWificond { | |||
57 | // | 55 | // |
58 | // @param callback object to remove from the set of registered callbacks. | 56 | // @param callback object to remove from the set of registered callbacks. |
59 | oneway void UnregisterCallback(IInterfaceEventCallback callback); | 57 | oneway void UnregisterCallback(IInterfaceEventCallback callback); |
60 | |||
61 | // Obtain a reference to a IRttController that can be used to | ||
62 | // request ranging information. | ||
63 | // Results will be returned via the registered IRttClient. | ||
64 | IRttController registerRttClient(IRttClient rttClient); | ||
65 | |||
66 | // Remove an IRttClient from the set of registered IRttClient callbacks. | ||
67 | // @param rttClient object to remove from the set of registered | ||
68 | // IRttClient callbacks. | ||
69 | void unregisterRttClient(IRttClient rttClient); | ||
70 | } | 58 | } |
diff --git a/rtt/rtt_controller_binder.cpp b/rtt/rtt_controller_binder.cpp deleted file mode 100644 index ba37018..0000000 --- a/rtt/rtt_controller_binder.cpp +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 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 "wificond/rtt/rtt_controller_binder.h" | ||
18 | |||
19 | #include "wificond/rtt/rtt_controller_impl.h" | ||
20 | |||
21 | namespace android { | ||
22 | namespace wificond { | ||
23 | |||
24 | RttControllerBinder::RttControllerBinder(RttControllerImpl* impl) : impl_{impl} { | ||
25 | } | ||
26 | |||
27 | RttControllerBinder::~RttControllerBinder() { | ||
28 | } | ||
29 | |||
30 | } // namespace wificond | ||
31 | } // namespace android | ||
diff --git a/rtt/rtt_controller_binder.h b/rtt/rtt_controller_binder.h deleted file mode 100644 index ed8ce81..0000000 --- a/rtt/rtt_controller_binder.h +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 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 | #ifndef WIFICOND_RTT_CONTROLLER_BINDER_H_ | ||
18 | #define WIFICOND_RTT_CONTROLLER_BINDER_H_ | ||
19 | |||
20 | #include <android-base/macros.h> | ||
21 | #include <binder/Status.h> | ||
22 | |||
23 | #include "android/net/wifi/BnRttController.h" | ||
24 | |||
25 | namespace android { | ||
26 | namespace wificond { | ||
27 | |||
28 | class RttControllerImpl; | ||
29 | |||
30 | class RttControllerBinder : public android::net::wifi::BnRttController { | ||
31 | public: | ||
32 | explicit RttControllerBinder(RttControllerImpl* impl); | ||
33 | ~RttControllerBinder() override; | ||
34 | |||
35 | // Called by |impl_| its destruction. | ||
36 | // This informs the binder proxy that no future manipulations of |impl_| | ||
37 | // by remote processes are possible. | ||
38 | void NotifyImplDead() { impl_ = nullptr; } | ||
39 | |||
40 | private: | ||
41 | RttControllerImpl* impl_; | ||
42 | |||
43 | DISALLOW_COPY_AND_ASSIGN(RttControllerBinder); | ||
44 | }; | ||
45 | |||
46 | } // namespace wificond | ||
47 | } // namespace android | ||
48 | |||
49 | #endif // WIFICOND_RTT_CONTROLLER_BINDER_H_ | ||
diff --git a/rtt/rtt_controller_impl.cpp b/rtt/rtt_controller_impl.cpp deleted file mode 100644 index 197faca..0000000 --- a/rtt/rtt_controller_impl.cpp +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 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 "wificond/rtt/rtt_controller_impl.h" | ||
18 | |||
19 | #include <android-base/logging.h> | ||
20 | |||
21 | #include "wificond/rtt/rtt_controller_binder.h" | ||
22 | |||
23 | using android::net::wifi::IRttClient; | ||
24 | using android::net::wifi::IRttController; | ||
25 | using android::sp; | ||
26 | |||
27 | namespace android { | ||
28 | namespace wificond { | ||
29 | |||
30 | RttControllerImpl::RttControllerImpl() | ||
31 | : binder_(new RttControllerBinder(this)) { | ||
32 | // TODO(nywang): create a HAL RttController object. | ||
33 | } | ||
34 | |||
35 | RttControllerImpl::~RttControllerImpl() { | ||
36 | binder_->NotifyImplDead(); | ||
37 | } | ||
38 | |||
39 | sp<IRttController> RttControllerImpl::GetBinder() const { | ||
40 | return binder_; | ||
41 | } | ||
42 | |||
43 | bool RttControllerImpl::RegisterRttClient(android::sp<IRttClient> client) { | ||
44 | for (auto& it : clients_) { | ||
45 | if (IRttClient::asBinder(client) == IRttClient::asBinder(it)) { | ||
46 | LOG(WARNING) << "Ignore duplicate RttClient registration"; | ||
47 | return false; | ||
48 | } | ||
49 | } | ||
50 | clients_.push_back(client); | ||
51 | return true; | ||
52 | |||
53 | } | ||
54 | |||
55 | bool RttControllerImpl::UnregisterRttClient(android::sp<IRttClient> client) { | ||
56 | for (auto it = clients_.begin(); it != clients_.end(); it++) { | ||
57 | if (IRttClient::asBinder(client) == IRttClient::asBinder(*it)) { | ||
58 | clients_.erase(it); | ||
59 | return true; | ||
60 | } | ||
61 | } | ||
62 | LOG(WARNING) << "Failed to find registered RttClient to unregister"; | ||
63 | return false; | ||
64 | } | ||
65 | |||
66 | size_t RttControllerImpl::GetClientCount() const { | ||
67 | return clients_.size(); | ||
68 | } | ||
69 | |||
70 | } // namespace wificond | ||
71 | } // namespace android | ||
diff --git a/rtt/rtt_controller_impl.h b/rtt/rtt_controller_impl.h deleted file mode 100644 index da650ef..0000000 --- a/rtt/rtt_controller_impl.h +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 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 | #ifndef WIFICOND_RTT_CONTROLLER_IMPL_H_ | ||
18 | #define WIFICOND_RTT_CONTROLLER_IMPL_H_ | ||
19 | |||
20 | #include <vector> | ||
21 | |||
22 | #include <android-base/macros.h> | ||
23 | |||
24 | #include "android/net/wifi/IRttController.h" | ||
25 | #include "android/net/wifi/IRttClient.h" | ||
26 | |||
27 | namespace android { | ||
28 | namespace wificond { | ||
29 | |||
30 | class RttControllerBinder; | ||
31 | |||
32 | class RttControllerImpl { | ||
33 | public: | ||
34 | RttControllerImpl(); | ||
35 | ~RttControllerImpl(); | ||
36 | |||
37 | bool RegisterRttClient(android::sp<android::net::wifi::IRttClient> client); | ||
38 | bool UnregisterRttClient(android::sp<android::net::wifi::IRttClient> client); | ||
39 | size_t GetClientCount() const; | ||
40 | |||
41 | // Get a pointer to the binder representing this RttControllerImpl. | ||
42 | android::sp<android::net::wifi::IRttController> GetBinder() const; | ||
43 | |||
44 | private: | ||
45 | const android::sp<RttControllerBinder> binder_; | ||
46 | std::vector<android::sp<android::net::wifi::IRttClient>> clients_; | ||
47 | |||
48 | DISALLOW_COPY_AND_ASSIGN(RttControllerImpl); | ||
49 | }; | ||
50 | |||
51 | } // namespace wificond | ||
52 | } // namespace android | ||
53 | |||
54 | #endif // WIFICOND_RTT_CONTROLLER_IMPL_H_ | ||
@@ -35,8 +35,6 @@ using android::IBinder; | |||
35 | using android::net::wifi::IApInterface; | 35 | using android::net::wifi::IApInterface; |
36 | using android::net::wifi::IClientInterface; | 36 | using android::net::wifi::IClientInterface; |
37 | using android::net::wifi::IInterfaceEventCallback; | 37 | using android::net::wifi::IInterfaceEventCallback; |
38 | using android::net::wifi::IRttClient; | ||
39 | using android::net::wifi::IRttController; | ||
40 | using android::wifi_system::HostapdManager; | 38 | using android::wifi_system::HostapdManager; |
41 | using android::wifi_system::InterfaceTool; | 39 | using android::wifi_system::InterfaceTool; |
42 | using android::wifi_system::SupplicantManager; | 40 | using android::wifi_system::SupplicantManager; |
@@ -96,25 +94,6 @@ Status Server::UnregisterCallback(const sp<IInterfaceEventCallback>& callback) { | |||
96 | return Status::ok(); | 94 | return Status::ok(); |
97 | } | 95 | } |
98 | 96 | ||
99 | Status Server::registerRttClient(const sp<IRttClient>& rtt_client, | ||
100 | sp<IRttController>* out_rtt_controller) { | ||
101 | if (rtt_controller_ == nullptr) { | ||
102 | rtt_controller_.reset(new RttControllerImpl()); | ||
103 | } | ||
104 | rtt_controller_->RegisterRttClient(rtt_client); | ||
105 | |||
106 | *out_rtt_controller = rtt_controller_->GetBinder(); | ||
107 | return Status::ok(); | ||
108 | } | ||
109 | |||
110 | Status Server::unregisterRttClient(const sp<IRttClient>& rttClient) { | ||
111 | rtt_controller_->UnregisterRttClient(rttClient); | ||
112 | if (rtt_controller_->GetClientCount() == 0) { | ||
113 | rtt_controller_.reset(); | ||
114 | } | ||
115 | return Status::ok(); | ||
116 | } | ||
117 | |||
118 | Status Server::createApInterface(sp<IApInterface>* created_interface) { | 97 | Status Server::createApInterface(sp<IApInterface>* created_interface) { |
119 | InterfaceInfo interface; | 98 | InterfaceInfo interface; |
120 | if (!SetupInterface(&interface)) { | 99 | if (!SetupInterface(&interface)) { |
@@ -31,7 +31,6 @@ | |||
31 | 31 | ||
32 | #include "wificond/ap_interface_impl.h" | 32 | #include "wificond/ap_interface_impl.h" |
33 | #include "wificond/client_interface_impl.h" | 33 | #include "wificond/client_interface_impl.h" |
34 | #include "wificond/rtt/rtt_controller_impl.h" | ||
35 | 34 | ||
36 | namespace android { | 35 | namespace android { |
37 | namespace wificond { | 36 | namespace wificond { |
@@ -58,15 +57,6 @@ class Server : public android::net::wifi::BnWificond { | |||
58 | const android::sp<android::net::wifi::IInterfaceEventCallback>& | 57 | const android::sp<android::net::wifi::IInterfaceEventCallback>& |
59 | callback) override; | 58 | callback) override; |
60 | 59 | ||
61 | android::binder::Status registerRttClient( | ||
62 | const ::android::sp<::android::net::wifi::IRttClient>& rtt_client, | ||
63 | ::android::sp<::android::net::wifi::IRttController>* | ||
64 | out_rtt_controller) override; | ||
65 | |||
66 | android::binder::Status unregisterRttClient( | ||
67 | const ::android::sp<::android::net::wifi::IRttClient>& | ||
68 | rttClient) override; | ||
69 | |||
70 | android::binder::Status createApInterface( | 60 | android::binder::Status createApInterface( |
71 | android::sp<android::net::wifi::IApInterface>* | 61 | android::sp<android::net::wifi::IApInterface>* |
72 | created_interface) override; | 62 | created_interface) override; |
@@ -120,8 +110,6 @@ class Server : public android::net::wifi::BnWificond { | |||
120 | std::vector<android::sp<android::net::wifi::IInterfaceEventCallback>> | 110 | std::vector<android::sp<android::net::wifi::IInterfaceEventCallback>> |
121 | interface_event_callbacks_; | 111 | interface_event_callbacks_; |
122 | 112 | ||
123 | std::unique_ptr<RttControllerImpl> rtt_controller_; | ||
124 | |||
125 | // Cached interface list from kernel. | 113 | // Cached interface list from kernel. |
126 | std::vector<InterfaceInfo> interfaces_; | 114 | std::vector<InterfaceInfo> interfaces_; |
127 | 115 | ||