Index: build/android/provision_devices.py |
diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py |
index a3922469c8e765a221e055635483a6ecf9fc254b..456744408b60eb809cbf15492e54ef4352a12fe9 100755 |
--- a/build/android/provision_devices.py |
+++ b/build/android/provision_devices.py |
@@ -19,6 +19,8 @@ import time |
from pylib import android_commands |
from pylib import constants |
+from pylib import device_settings |
+ |
def KillHostHeartbeat(): |
ps = subprocess.Popen(['ps', 'aux'], stdout = subprocess.PIPE) |
@@ -65,6 +67,19 @@ def PushAndLaunchAdbReboot(devices, target): |
LaunchHostHeartbeat() |
+def _ConfigureLocalProperties(adb): |
+ """Set standard readonly testing device properties prior to reboot.""" |
+ local_props = ['ro.monkey=1', |
bulach
2014/02/26 15:23:59
ultra nit: perhaps:
local_props = [
...,
...,
tonyg
2014/02/26 16:52:58
Done.
|
+ 'ro.test_harness=1', |
+ 'ro.audio.silent=1', |
+ 'ro.setupwizard.mode=DISABLED'] |
+ adb.SetProtectedFileContents(android_commands.LOCAL_PROPERTIES_PATH, |
+ '\n'.join(local_props)) |
+ # Android will not respect the local props file if it is world writable. |
+ adb.RunShellCommandWithSU('chmod 644 %s' % |
+ android_commands.LOCAL_PROPERTIES_PATH) |
+ |
+ |
def ProvisionDevices(options): |
if options.device is not None: |
devices = [options.device] |
@@ -72,6 +87,14 @@ def ProvisionDevices(options): |
devices = android_commands.GetAttachedDevices() |
for device in devices: |
android_cmd = android_commands.AndroidCommands(device) |
+ _ConfigureLocalProperties(android_cmd) |
+ device_settings.ConfigureContentSettingsDict( |
+ android_cmd, device_settings.DETERMINISTIC_DEVICE_SETTINGS) |
+ # TODO(tonyg): We eventually want network on. However, currently radios |
+ # can cause perfbots to drain faster than they charge. |
+ if 'Perf' in os.environ.get('BUILDBOT_BUILDERNAME', ''): |
bulach
2014/02/26 15:23:59
nit: s/Perf/ and use a .lower()
so this would work
tonyg
2014/02/26 16:52:58
Done.
|
+ device_settings.ConfigureContentSettingsDict( |
+ android_cmd, device_settings.NETWORK_DISABLED_SETTINGS) |
android_cmd.RunShellCommandWithSU('date -u %f' % time.time()) |
if options.auto_reconnect: |
PushAndLaunchAdbReboot(devices, options.target) |