summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Tan <samueltan@google.com>2016-01-15 19:41:02 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-01-15 19:41:02 +0000
commit3370f9b2e7c3f8d073fd16151f15a4dd2c660903 (patch)
tree89c1020b787a6f2eb29cbb3d3859f93a459aff44
parent803589483cc44272bfbc4fd31318921ac721f0e5 (diff)
parent2cee1a38432678d57888315a8e9bd0882c881c22 (diff)
downloadshill-3370f9b2e7c3f8d073fd16151f15a4dd2c660903.tar.gz
shill: do not create service watcher via DeviceClaimer
am: 2cee1a3843 * commit '2cee1a38432678d57888315a8e9bd0882c881c22': shill: do not create service watcher via DeviceClaimer
-rw-r--r--device_claimer.cc13
-rw-r--r--device_claimer.h4
-rw-r--r--device_claimer_unittest.cc15
-rw-r--r--manager.cc3
-rw-r--r--manager_unittest.cc2
5 files changed, 0 insertions, 37 deletions
diff --git a/device_claimer.cc b/device_claimer.cc
index 355f8773..581dc1ec 100644
--- a/device_claimer.cc
+++ b/device_claimer.cc
@@ -42,19 +42,6 @@ DeviceClaimer::~DeviceClaimer() {
}
}
-bool DeviceClaimer::StartServiceWatcher(
- ControlInterface* control_interface,
- const base::Closure& connection_vanished_callback) {
- if (service_watcher_) {
- LOG(ERROR) << "Service watcher already started";
- return false;
- }
- service_watcher_.reset(
- control_interface->CreateRPCServiceWatcher(service_name_,
- connection_vanished_callback));
- return true;
-}
-
bool DeviceClaimer::Claim(const string& device_name, Error* error) {
// Check if device is claimed already.
if (claimed_device_names_.find(device_name) != claimed_device_names_.end()) {
diff --git a/device_claimer.h b/device_claimer.h
index d7fba406..e8ec17d0 100644
--- a/device_claimer.h
+++ b/device_claimer.h
@@ -42,10 +42,6 @@ class DeviceClaimer {
bool default_claimer);
virtual ~DeviceClaimer();
- virtual bool StartServiceWatcher(
- ControlInterface* control_interface,
- const base::Closure& connection_vanished_callback);
-
virtual bool Claim(const std::string& device_name, Error* error);
virtual bool Release(const std::string& device_name, Error* error);
diff --git a/device_claimer_unittest.cc b/device_claimer_unittest.cc
index c15d536c..9e8e50ce 100644
--- a/device_claimer_unittest.cc
+++ b/device_claimer_unittest.cc
@@ -47,21 +47,6 @@ class DeviceClaimerTest : public testing::Test {
DeviceClaimer device_claimer_;
};
-TEST_F(DeviceClaimerTest, StartServiceWatcher) {
- // Start service watcher.
- MockControl control;
- EXPECT_CALL(control, CreateRPCServiceWatcher(_, _))
- .WillOnce(Return(new MockServiceWatcher()));
- EXPECT_TRUE(device_claimer_.StartServiceWatcher(&control, base::Closure()));
- Mock::VerifyAndClearExpectations(&control);
-
- // Start service watcher again, should fail since name watcher already
- // started.
- EXPECT_CALL(control, CreateRPCServiceWatcher(_, _)).Times(0);
- EXPECT_FALSE(device_claimer_.StartServiceWatcher(&control, base::Closure()));
- Mock::VerifyAndClearExpectations(&control);
-}
-
TEST_F(DeviceClaimerTest, ClaimAndReleaseDevices) {
// Should not have any device claimed initially.
EXPECT_FALSE(device_claimer_.DevicesClaimed());
diff --git a/manager.cc b/manager.cc
index 55b3da5c..7c1f6631 100644
--- a/manager.cc
+++ b/manager.cc
@@ -699,9 +699,6 @@ void Manager::ClaimDevice(const string& claimer_name,
// since we are using message sender as the claimer name.
device_claimer_.reset(
new DeviceClaimer(claimer_name, &device_info_, false));
- device_claimer_->StartServiceWatcher(
- control_interface_,
- Bind(&Manager::OnDeviceClaimerVanished, Unretained(this)));
}
// Verify claimer's name, since we only allow one claimer to exist at a time.
diff --git a/manager_unittest.cc b/manager_unittest.cc
index 828943fd..5409ef86 100644
--- a/manager_unittest.cc
+++ b/manager_unittest.cc
@@ -4905,8 +4905,6 @@ TEST_F(ManagerTest, ClaimDeviceWithoutClaimer) {
// Claim device when device claimer doesn't exist yet.
Error error;
- EXPECT_CALL(*control_interface(), CreateRPCServiceWatcher(_, _))
- .WillOnce(Return(new MockServiceWatcher()));
manager()->ClaimDevice(kClaimerName, kDeviceName, &error);
EXPECT_TRUE(error.IsSuccess());
EXPECT_TRUE(manager()->device_info()->IsDeviceBlackListed(kDeviceName));