Bug 848124 - instrument b2gautomation to send environment variables to the on device process, r=jgriffin

This commit is contained in:
Andrew Halberstadt 2013-03-06 16:53:48 -05:00
Родитель a04b817cbf
Коммит 6a7bc77ca2
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -240,7 +240,7 @@ class B2GRemoteAutomation(Automation):
time.sleep(5)
# relaunch b2g inside b2g instance
instance = self.B2GInstance(self._devicemanager)
instance = self.B2GInstance(self._devicemanager, env=env)
time.sleep(5)
@ -298,8 +298,9 @@ class B2GRemoteAutomation(Automation):
automation.
"""
def __init__(self, dm):
def __init__(self, dm, env=None):
self.dm = dm
self.env = env or {}
self.stdout_proc = None
self.queue = Queue.Queue()
@ -311,6 +312,8 @@ class B2GRemoteAutomation(Automation):
if self.dm._deviceSerial:
cmd.extend(['-s', self.dm._deviceSerial])
cmd.append('shell')
for k, v in self.env.iteritems():
cmd.append("%s=%s" % (k, v))
cmd.append('/system/bin/b2g.sh')
proc = threading.Thread(target=self._save_stdout_proc, args=(cmd, self.queue))
proc.daemon = True