learningequality / kolibri-installer-android

Android wrapper for Kolibri.
MIT License
26 stars 22 forks source link

Intent for remote shell #154

Closed jredrejo closed 1 year ago

jredrejo commented 1 year ago

With the latest changes in the android build, remoteshell does not start by default when the app is started. This PR creates the needed intent to start remoteshell using an adb command.

When using an intent, the start method of the service is not called, the onStartCommand is called directly in the service lifecycle. For this reason this method has been overriden in the ServiceRemoteShell.java file. If we don't call the service anymore from the android app using startservice we could remove most of the code that handles the start, only the onStartCommand method would be needed.

In order to start the shell: adb shell am startservice -n org.learningequality.Kolibri/org.learningequality.Kolibri.ServiceRemoteshell -a org.learningequality.Kolibri.START_REMOTESHELL

to stop it: adb shell am stopservice -n org.learningequality.Kolibri/org.learningequality.Kolibri.ServiceRemoteshell -a org.learningequality.Kolibri.START_REMOTESHELL

Closes: #150

NOTE: If this is approved, https://github.com/learningequality/kolibri-provisioning-tools/blob/master/kolibri_provisioning_tools/clients.py must be modified to use this mechanism. Then #143 can be solved.