Add support to start and stop SDK sandbox services
Starting the sandbox service instead of just binding gives us better
control over the sandbox:
* There is no longer a dependency on using BIND_AUTO_CREATE to create a
sandbox process. Sandbox restarts can therefore be disabled if needed.
* The sandbox can be killed by stopping the service instead of using
killUid(). Therefore, the sandbox can be informed when it is about to
die. Killing multiple sandboxes sharing a uid can also be avoided.
Bug: 239562510
Test: atest SdkSandboxLifecycleHostTest
Change-Id: I5c2302a58beb71b08c4d435625e791006bacd3fb
diff --git a/services/api/current.txt b/services/api/current.txt
index 329dbdf..b55166c 100644
--- a/services/api/current.txt
+++ b/services/api/current.txt
@@ -43,6 +43,8 @@
method @Deprecated public boolean bindSdkSandboxService(@NonNull android.content.Intent, @NonNull android.content.ServiceConnection, int, @NonNull String, @NonNull String, int) throws android.os.RemoteException;
method public boolean canStartForegroundService(int, int, @NonNull String);
method public void killSdkSandboxClientAppProcess(@NonNull android.os.IBinder);
+ method @Nullable public android.content.ComponentName startSdkSandboxService(@NonNull android.content.Intent, int, @NonNull String, @NonNull String) throws android.os.RemoteException;
+ method public boolean stopSdkSandboxService(@NonNull android.content.Intent, int, @NonNull String, @NonNull String);
}
}