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

Unified Diff: build/android/provision_devices.py

Issue 1980723002: [Android] Fix time zone handling when setting the date in provision_devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/provision_devices.py
diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py
index 3d5ad7423bf8fb7521b755ad4a5bb1564668d836..8890fc0df2ad77b2b2ac78c6d65fae2d6a903082 100755
--- a/build/android/provision_devices.py
+++ b/build/android/provision_devices.py
@@ -369,16 +369,16 @@ def FinishProvisioning(device, options):
def _set_and_verify_date():
if device.build_version_sdk >= version_codes.MARSHMALLOW:
date_format = '%m%d%H%M%Y.%S'
- set_date_command = ['date']
+ set_date_command = ['date', '-u']
ghost stip (do not use) 2016/05/13 20:32:48 do we need to mirror this logic in https://goto.go
else:
date_format = '%Y%m%d.%H%M%S'
- set_date_command = ['date', '-s']
+ set_date_command = ['date', '-u', '-s']
strgmtime = time.strftime(date_format, time.gmtime())
set_date_command.append(strgmtime)
device.RunShellCommand(set_date_command, as_root=True, check_return=True)
device_time = device.RunShellCommand(
- ['date', '+"%Y%m%d.%H%M%S"'], as_root=True,
+ ['date', '-u', '+"%Y%m%d.%H%M%S"'], as_root=True,
single_line=True).replace('"', '')
device_time = datetime.datetime.strptime(device_time, "%Y%m%d.%H%M%S")
correct_time = datetime.datetime.strptime(strgmtime, date_format)
« 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