bluetooth_socket: add commands to add & remove device from action list
BUG=chromium:433561
TEST=test with an autotest
Change-Id: I110d2d1dd1a934f78de29de54c50cec79650821d
Reviewed-on: https://chromium-review.googlesource.com/232491
Tested-by: Scott James Remnant <keybuk@chromium.org>
Reviewed-by: Arman Uguray <armansito@chromium.org>
Commit-Queue: Scott James Remnant <keybuk@chromium.org>
diff --git a/server/cros/bluetooth/bluetooth_device.py b/server/cros/bluetooth/bluetooth_device.py
index 60e1b00..20ec115 100644
--- a/server/cros/bluetooth/bluetooth_device.py
+++ b/server/cros/bluetooth/bluetooth_device.py
@@ -147,6 +147,33 @@
return json.loads(self._proxy.read_info())
+ def add_device(self, address, address_type, action):
+ """Add a device to the Kernel action list.
+
+ @param address: Address of the device to add.
+ @param address_type: Type of device in @address.
+ @param action: Action to take.
+
+ @return tuple of ( address, address_type ) on success,
+ None on failure.
+
+ """
+ return json.loads(self._proxy.add_device(address, address_type, action))
+
+
+ def remove_device(self, address, address_type):
+ """Remove a device from the Kernel action list.
+
+ @param address: Address of the device to remove.
+ @param address_type: Type of device in @address.
+
+ @return tuple of ( address, address_type ) on success,
+ None on failure.
+
+ """
+ return json.loads(self._proxy.remove_device(address, address_type))
+
+
def get_devices(self):
"""Read information about remote devices known to the adapter.