Skip to content

Commit

Permalink
Add a 'check_current' parameter to 'launch_app'
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffLIrion committed Jan 3, 2020
1 parent 339cea2 commit e5785cd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions androidtv/basetv.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,16 +805,21 @@ def _send_intent(self, pkg, intent, count=1):

return {"output": output, "retcode": retcode}

def launch_app(self, app):
def launch_app(self, app, check_current=True):
"""Launch an app.
Parameters
----------
app : str
The ID of the app that will be launched
check_current : book
Whether to check that the app is not already the current app before launching it
"""
self._adb.shell(constants.CMD_LAUNCH_APP.format(app))
if check_current:
self._adb.shell(constants.CMD_LAUNCH_APP.format(app))
else:
self._send_intent(app, constants.INTENT_LAUNCH)

def stop_app(self, app):
"""Stop an app.
Expand Down

0 comments on commit e5785cd

Please sign in to comment.