mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 698010 - Make deviceManagerADB.py killProcess method actually work. r=jmaher
This commit is contained in:
parent
e3dfcb5651
commit
4c4871980f
@ -256,11 +256,11 @@ class DeviceManagerADB(DeviceManager):
|
||||
# failure: None
|
||||
def killProcess(self, appname):
|
||||
procs = self.getProcessList()
|
||||
for proc in procs:
|
||||
if (proc[1] == appname):
|
||||
p = self.runCmd(["shell", "ps"])
|
||||
for (pid, name, user) in procs:
|
||||
if name == appname:
|
||||
p = self.runCmdAs(["shell", "kill", pid])
|
||||
return p.stdout.read()
|
||||
return None
|
||||
return None
|
||||
|
||||
# external function
|
||||
# returns:
|
||||
@ -506,6 +506,12 @@ class DeviceManagerADB(DeviceManager):
|
||||
args.insert(0, "adb")
|
||||
return subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
|
||||
def runCmdAs(self, args):
|
||||
if self.useRunAs:
|
||||
args.insert(1, "run-as")
|
||||
args.insert(2, self.packageName)
|
||||
return self.runCmd(args)
|
||||
|
||||
def checkCmd(self, args):
|
||||
args.insert(0, "adb")
|
||||
return subprocess.check_call(args)
|
||||
|
Loading…
Reference in New Issue
Block a user