Migration to Java 9: unify managed and unmanaged applications
Currently the Java 8 API does not allow to control the execution of a Process that is not started by the parent JVM. The Java 9 API will solve this by adding:
- Concept of ProcessHandle that can be accessed for all running processes using the allProcesses method.
- Process ID accessible for any process on any platform.
The documentation can be read here: Java 9 Process API. Before migrating, we will have to check that Android supports Java 9.
Notice that currently there can be strange behaviours. For example when starting an application as unmanaged, it is possible to connect to it in a different program but trying to kill and wait for its termination will block.