Index: build/android/devil/android/device_blacklist.py |
diff --git a/build/android/devil/android/device_blacklist.py b/build/android/devil/android/device_blacklist.py |
index 615b3e6bea5fef2f4ca6a522cdc7c4656d0862cc..0724654be7b9b5575eb551ce9eda7cb82ca5e095 100644 |
--- a/build/android/devil/android/device_blacklist.py |
+++ b/build/android/devil/android/device_blacklist.py |
@@ -3,7 +3,6 @@ |
# found in the LICENSE file. |
import json |
-import logging |
import os |
import threading |
@@ -50,16 +49,34 @@ |
Args: |
devices: list of bad devices to be added to the blacklist file. |
""" |
- logging.info('Adding %s to blacklist %s', ','.join(devices), self._path) |
with self._blacklist_lock: |
- blacklist = self.Read() |
+ blacklist = ReadBlacklist() |
blacklist.extend(devices) |
- self.Write(blacklist) |
+ WriteBlacklist(blacklist) |
def Reset(self): |
"""Erases the blacklist file if it exists.""" |
- logging.info('Resetting blacklist %s', self._path) |
with self._blacklist_lock: |
if os.path.exists(self._path): |
os.remove(self._path) |
+ |
+def ReadBlacklist(): |
+ # TODO(jbudorick): Phase out once all clients have migrated. |
+ return Blacklist(BLACKLIST_JSON).Read() |
+ |
+ |
+def WriteBlacklist(blacklist): |
+ # TODO(jbudorick): Phase out once all clients have migrated. |
+ Blacklist(BLACKLIST_JSON).Write(blacklist) |
+ |
+ |
+def ExtendBlacklist(devices): |
+ # TODO(jbudorick): Phase out once all clients have migrated. |
+ Blacklist(BLACKLIST_JSON).Extend(devices) |
+ |
+ |
+def ResetBlacklist(): |
+ # TODO(jbudorick): Phase out once all clients have migrated. |
+ Blacklist(BLACKLIST_JSON).Reset() |
+ |