1
0
mirror of https://github.com/ARM-software/devlib.git synced 2024-10-06 10:50:51 +01:00

AndroidTarget: Added android_id property

Get the device's ANDROID_ID. Which is
  "A 64-bit number (as a hex string) that is randomly generated when the user
   first sets up the device and should remain constant for the lifetime of the
   user's device."
This commit is contained in:
Sebastian Goscik 2016-02-15 15:17:32 +00:00
parent be8f972f60
commit cafeb81b83

View File

@ -643,6 +643,21 @@ class AndroidTarget(Target):
def adb_name(self):
return self.conn.device
@property
def android_id(self):
"""
Get the device's ANDROID_ID. Which is
"A 64-bit number (as a hex string) that is randomly generated when the user
first sets up the device and should remain constant for the lifetime of the
user's device."
.. note:: This will get reset on userdata erasure.
"""
output = self.execute('content query --uri content://settings/secure --projection value --where "name=\'android_id\'"').strip()
return output.split('value=')[-1]
@property
@memoized
def screen_resolution(self):