=== modified file 'lava_dispatcher/client/base.py'
@@ -59,7 +59,7 @@
index = 0
while index == 0:
index = self._connection.expect(
- ['.+', pexpect.EOF, pexpect.TIMEOUT], timeout=1,lava_no_logging=1)
+ ['.+', pexpect.EOF, pexpect.TIMEOUT], timeout=1, lava_no_logging=1)
def run(self, cmd, response=None, timeout=-1):
"""Run `cmd` and wait for a shell response.
@@ -126,7 +126,7 @@
def wait_network_up(self, timeout=300):
"""Wait until the networking is working."""
now = time.time()
- while time.time() < now+timeout:
+ while time.time() < now + timeout:
if self._check_network_up():
return
raise NetworkError
@@ -230,7 +230,7 @@
def wait_home_screen(self):
cmd = 'getprop init.svc.bootanim'
for count in range(100):
- self.run(cmd, response='stopped', timeout=5)
+ self.run(cmd, response=['stopped', pexpect.TIMEOUT], timeout=5)
if self.match_id == 0:
return True
time.sleep(1)
@@ -403,16 +403,30 @@
if self.config.get("enable_network_after_boot_android"):
time.sleep(1)
self._enable_network()
-
+
self._enable_adb_over_tcpip()
+ self._disable_suspend()
+
+ def _disable_suspend(self):
+ """ disable the suspend of images.
+ this needs wait unitl the home screen displayed"""
+ session = AndroidTesterCommandRunner(self)
+ session.wait_home_screen()
+ stay_awake = "delete from system where name='stay_on_while_plugged_in'; insert into system (name, value) values ('stay_on_while_plugged_in','3');"
+ screen_sleep = "delete from system where name='screen_off_timeout'; insert into system (name, value) values ('screen_off_timeout','-1');"
+ lockscreen = "delete from secure where name='lockscreen.disabled'; insert into secure (name, value) values ('lockscreen.disabled','1');"
+ session.run('sqlite3 /data/data/com.android.providers.settings/databases/settings.db "%s"' % (stay_awake)) ## set stay awake
+ session.run('sqlite3 /data/data/com.android.providers.settings/databases/settings.db "%s"' % (screen_sleep)) ## set sleep to none
+ session.run('sqlite3 /data/data/com.android.providers.settings/databases/settings.db "%s"' % (lockscreen)) ##set lock screen to none
+ session.run('input keyevent 82') ##unlock the home screen
+ session.run('service call power 1 i32 26') ##acquireWakeLock FULL_WAKE_LOCK
def _enable_network(self):
- network_interface = self.default_network_interface
session = TesterCommandRunner(self, wait_for_rc=False)
session.run("netcfg", timeout=20)
- session.run("netcfg %s up"%self.default_network_interface, timeout=20)
- session.run("netcfg %s dhcp"%self.default_network_interface, timeout=300)
- session.run("ifconfig " + self.default_network_interface, timeout=20)
+ session.run("netcfg %s up" % self.default_network_interface, timeout=20)
+ session.run("netcfg %s dhcp" % self.default_network_interface, timeout=300)
+ session.run("ifconfig " + self.default_network_interface, timeout=20)
def _enable_adb_over_tcpip(self):
=== modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/panda.conf'
@@ -14,5 +14,5 @@
setenv bootargs "'console=tty0 console=ttyO2,115200n8
rootwait rw earlyprintk fixrtc nocompcache vram=48M
omapfb.vram=0:24M,1:24M mem=456M@0x80000000 mem=512M@0xA0000000
- init=/init androidboot.console=ttyO2'",
+ init=/init androidboot.console=ttyO2 no_console_suspend'",
boot