summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNingyuan Wang2017-08-22 18:57:31 -0500
committerandroid-build-merger2017-08-22 18:57:31 -0500
commit03c0cf27ae318db90177f765823eee7bf7a6c5a8 (patch)
tree81919886ae94c17c2cfce0e59b157e1fa872ee94
parentf74f00f7f928e9617ae509e5eedab4e60aa9828d (diff)
parent7018247f52c2cf15d960b4b66bee7f1f75ff34ef (diff)
downloadsystem-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.mk4
-rw-r--r--aidl/android/net/wifi/IRttClient.aidl21
-rw-r--r--aidl/android/net/wifi/IRttController.aidl21
-rw-r--r--aidl/android/net/wifi/IWificond.aidl12
-rw-r--r--rtt/rtt_controller_binder.cpp31
-rw-r--r--rtt/rtt_controller_binder.h49
-rw-r--r--rtt/rtt_controller_impl.cpp71
-rw-r--r--rtt/rtt_controller_impl.h54
-rw-r--r--server.cpp21
-rw-r--r--server.h12
10 files changed, 0 insertions, 296 deletions
diff --git a/Android.mk b/Android.mk
index cd4855e..163e3d1 100644
--- a/Android.mk
+++ b/Android.mk
@@ -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
17package android.net.wifi;
18
19interface 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
17package android.net.wifi;
18
19interface 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;
19import android.net.wifi.IApInterface; 19import android.net.wifi.IApInterface;
20import android.net.wifi.IClientInterface; 20import android.net.wifi.IClientInterface;
21import android.net.wifi.IInterfaceEventCallback; 21import android.net.wifi.IInterfaceEventCallback;
22import android.net.wifi.IRttClient;
23import 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
21namespace android {
22namespace wificond {
23
24RttControllerBinder::RttControllerBinder(RttControllerImpl* impl) : impl_{impl} {
25}
26
27RttControllerBinder::~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
25namespace android {
26namespace wificond {
27
28class RttControllerImpl;
29
30class 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
23using android::net::wifi::IRttClient;
24using android::net::wifi::IRttController;
25using android::sp;
26
27namespace android {
28namespace wificond {
29
30RttControllerImpl::RttControllerImpl()
31 : binder_(new RttControllerBinder(this)) {
32 // TODO(nywang): create a HAL RttController object.
33}
34
35RttControllerImpl::~RttControllerImpl() {
36 binder_->NotifyImplDead();
37}
38
39sp<IRttController> RttControllerImpl::GetBinder() const {
40 return binder_;
41}
42
43bool 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
55bool 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
66size_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
27namespace android {
28namespace wificond {
29
30class RttControllerBinder;
31
32class 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_
diff --git a/server.cpp b/server.cpp
index be57e89..88010fb 100644
--- a/server.cpp
+++ b/server.cpp
@@ -35,8 +35,6 @@ using android::IBinder;
35using android::net::wifi::IApInterface; 35using android::net::wifi::IApInterface;
36using android::net::wifi::IClientInterface; 36using android::net::wifi::IClientInterface;
37using android::net::wifi::IInterfaceEventCallback; 37using android::net::wifi::IInterfaceEventCallback;
38using android::net::wifi::IRttClient;
39using android::net::wifi::IRttController;
40using android::wifi_system::HostapdManager; 38using android::wifi_system::HostapdManager;
41using android::wifi_system::InterfaceTool; 39using android::wifi_system::InterfaceTool;
42using android::wifi_system::SupplicantManager; 40using 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
99Status 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
110Status 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
118Status Server::createApInterface(sp<IApInterface>* created_interface) { 97Status Server::createApInterface(sp<IApInterface>* created_interface) {
119 InterfaceInfo interface; 98 InterfaceInfo interface;
120 if (!SetupInterface(&interface)) { 99 if (!SetupInterface(&interface)) {
diff --git a/server.h b/server.h
index 8fc3d77..4c131d4 100644
--- a/server.h
+++ b/server.h
@@ -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
36namespace android { 35namespace android {
37namespace wificond { 36namespace 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