Intent for remote shell #154
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
onStartCommandis called directly in the service lifecycle. For this reason this method has been overriden in theServiceRemoteShell.javafile. If we don't call the service anymore from the android app using startservice we could remove most of the code that handles thestart, only theonStartCommandmethod 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_REMOTESHELLto stop it:
adb shell am stopservice -n org.learningequality.Kolibri/org.learningequality.Kolibri.ServiceRemoteshell -a org.learningequality.Kolibri.START_REMOTESHELLCloses: #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.