Home | History | Annotate | Download | only in android

Lines Matching refs:blacklist

14 class Blacklist(object):
21 """Reads the blacklist from the blacklist file.
27 blacklist = dict()
29 return blacklist
33 blacklist = json.load(f)
35 logger.warning('Unable to read blacklist: %s', str(e))
38 if not isinstance(blacklist, dict):
40 self._path, blacklist)
41 blacklist = dict()
43 return blacklist
45 def Write(self, blacklist):
46 """Writes the provided blacklist to the blacklist file.
49 blacklist: list of bad devices to write to the blacklist file.
53 json.dump(blacklist, f)
56 """Adds devices to blacklist file.
59 devices: list of bad devices to be added to the blacklist file.
60 reason: string specifying the reason for blacklist (eg: 'unauthorized')
68 logger.info('Adding %s to blacklist %s for reason: %s',
71 blacklist = self.Read()
72 blacklist.update(device_dicts)
73 self.Write(blacklist)
76 """Erases the blacklist file if it exists."""
77 logger.info('Resetting blacklist %s', self._path)