Closed
Bug 1016073
Opened 10 years ago
Closed 10 years ago
mozdevice's stopApplication should work on older versions of Android
Categories
(Testing :: Mozbase, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla32
People
(Reporter: wlach, Assigned: wlach)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
wlach
:
review+
|
Details | Diff | Splinter Review |
While hacking on bug 1016041 for eideticker, I realized that I had written some compatibility type code which tries to kill a browser in a similar way to "am force-stop" (i.e. trying repeatedly over a duration to kill all instances of a process), since just running killProcess seems not to be 100% reliable (because background processes might occasionally be launched when you're in the process of killing the browser).
We may as well try to consolidate this code inside devicemanager so other people can use it.
Assignee | ||
Comment 1•10 years ago
|
||
Assignee: nobody → wlachance
Attachment #8428892 -
Flags: review?(bclary)
Comment 2•10 years ago
|
||
Comment on attachment 8428892 [details] [diff] [review]
Add Android 2.x support to stopApplication
Review of attachment 8428892 [details] [diff] [review]:
-----------------------------------------------------------------
::: testing/mozbase/mozdevice/mozdevice/droid.py
@@ +141,5 @@
> + if num_tries > max_tries:
> + raise DMError("Couldn't successfully kill %s after %s "
> + "tries" % (appName, max_tries))
> + self.killProcess(appName)
> + num_tries+=1
spaces
@@ +144,5 @@
> + self.killProcess(appName)
> + num_tries+=1
> + # sleep for a short duration to make sure there are no
> + # additional processes in the process of being launched
> + time.sleep(0.1)
How did you decide on 0.1 seconds?
Attachment #8428892 -
Flags: review?(bclary) → review+
Assignee | ||
Comment 3•10 years ago
|
||
(In reply to Bob Clary [:bc:] from comment #2)
> Comment on attachment 8428892 [details] [diff] [review]
> Add Android 2.x support to stopApplication
>
> Review of attachment 8428892 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: testing/mozbase/mozdevice/mozdevice/droid.py
> @@ +141,5 @@
> > + if num_tries > max_tries:
> > + raise DMError("Couldn't successfully kill %s after %s "
> > + "tries" % (appName, max_tries))
> > + self.killProcess(appName)
> > + num_tries+=1
>
> spaces
How do you mean?
> @@ +144,5 @@
> > + self.killProcess(appName)
> > + num_tries+=1
> > + # sleep for a short duration to make sure there are no
> > + # additional processes in the process of being launched
> > + time.sleep(0.1)
>
> How did you decide on 0.1 seconds?
It's pretty much arbitrary and thus probably flakey. I'll update the comment to admit this, and maybe lengthen the timeout to a second. Fortunately we only need to use this functionality on Android 2.3 and below.
Assignee | ||
Comment 4•10 years ago
|
||
Updating patch, carrying forward r+
Attachment #8428892 -
Attachment is obsolete: true
Attachment #8429541 -
Flags: review+
Comment 5•10 years ago
|
||
(In reply to William Lachance (:wlach) from comment #3)
> > > + num_tries+=1
> >
> > spaces
>
> How do you mean?
spaces around the operator? num_tries+=1 -> num_tries += 1
The new patch is fine if you are ok with the spaces.
Assignee | ||
Comment 6•10 years ago
|
||
Attachment #8429541 -
Attachment is obsolete: true
Attachment #8429572 -
Flags: review+
Assignee | ||
Comment 7•10 years ago
|
||
Note for sheriffs; no need for try run as nothing in the tree actually uses this method (
http://mxr.mozilla.org/mozilla-central/search?string=stopApplication). I have tested this locally and it works well.
Keywords: checkin-needed
Comment 8•10 years ago
|
||
Keywords: checkin-needed
Comment 9•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in
before you can comment on or make changes to this bug.
Description
•