Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3368)

Unified Diff: build/android/pylib/android_commands.py

Issue 17088005: [Android] Add GetDescription and defer calculating device_utc_offset (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/android_commands.py
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
index f260639352cb073fa6674acbf979f0a307361f44..9146c020f00e6231c6d70ef3360b61bb98a62774 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -219,7 +219,7 @@ class AndroidCommands(object):
self.logcat_process = None
self._logcat_tmpoutfile = None
self._pushed_files = []
- self._device_utc_offset = self.RunShellCommand('date +%z')[0]
+ self._device_utc_offset = None
self._md5sum_build_dir = ''
self._external_storage = ''
self._util_wrapper = ''
@@ -848,7 +848,12 @@ class AndroidCommands(object):
'(?P<filename>[^\s]+)$')
return _GetFilesFromRecursiveLsOutput(
path, self.RunShellCommand('ls -lR %s' % path), re_file,
- self._device_utc_offset)
+ self.GetUtcOffset())
+
+ def GetUtcOffset(self):
+ if not self._device_utc_offset:
+ self._device_utc_offset = self.RunShellCommand('date +%z')[0]
+ return self._device_utc_offset
def SetJavaAssertsEnabled(self, enable):
"""Sets or removes the device java assertions property.
@@ -898,8 +903,17 @@ class AndroidCommands(object):
assert build_type
return build_type
+ def GetDescription(self):
+ """Returns the description of the system.
+
+ For example, "yakju-userdebug 4.1 JRN54F 364167 dev-keys".
+ """
+ description = self.RunShellCommand('getprop ro.build.description')[0]
+ assert description
+ return description
+
def GetProductModel(self):
- """Returns the namve of the product model (e.g. "Galaxy Nexus") """
+ """Returns the name of the product model (e.g. "Galaxy Nexus") """
model = self.RunShellCommand('getprop ro.product.model')[0]
assert model
return model
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698