diff --git a/core/api/current.txt b/core/api/current.txt index ee25ab5f9b9fd..74b3ba93564a9 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -363,6 +363,7 @@ package android { field public static final int allowGameFpsOverride = 16844378; // 0x101065a field public static final int allowNativeHeapPointerTagging = 16844306; // 0x1010612 field public static final int allowParallelSyncs = 16843570; // 0x1010332 + field public static final int allowSharedIsolatedProcess; field public static final int allowSingleTap = 16843353; // 0x1010259 field public static final int allowTaskReparenting = 16843268; // 0x1010204 field public static final int allowUndo = 16843999; // 0x10104df @@ -9957,6 +9958,7 @@ package android.content { field public static final int BIND_INCLUDE_CAPABILITIES = 4096; // 0x1000 field public static final int BIND_NOT_FOREGROUND = 4; // 0x4 field public static final int BIND_NOT_PERCEPTIBLE = 256; // 0x100 + field public static final int BIND_SHARED_ISOLATED_PROCESS = 8192; // 0x2000 field public static final int BIND_WAIVE_PRIORITY = 32; // 0x20 field public static final String BIOMETRIC_SERVICE = "biometric"; field public static final String BLOB_STORE_SERVICE = "blob_store"; @@ -12533,6 +12535,7 @@ package android.content.pm { method public void dump(android.util.Printer, String); method public int getForegroundServiceType(); field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field public static final int FLAG_ALLOW_SHARED_ISOLATED_PROCESS = 16; // 0x10 field public static final int FLAG_EXTERNAL_SERVICE = 4; // 0x4 field public static final int FLAG_ISOLATED_PROCESS = 2; // 0x2 field public static final int FLAG_SINGLE_USER = 1073741824; // 0x40000000 diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 06c20fe3eb104..708a02dcfeb8f 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -277,7 +277,8 @@ public abstract class Context { BIND_IMPORTANT, BIND_ADJUST_WITH_ACTIVITY, BIND_NOT_PERCEPTIBLE, - BIND_INCLUDE_CAPABILITIES + BIND_INCLUDE_CAPABILITIES, + BIND_SHARED_ISOLATED_PROCESS }) @Retention(RetentionPolicy.SOURCE) public @interface BindServiceFlags {} @@ -394,6 +395,22 @@ public abstract class Context { */ public static final int BIND_INCLUDE_CAPABILITIES = 0x000001000; + /** + * Flag for {@link #bindIsolatedService}: Bind the service into a shared isolated process. + * Specifying this flag allows multiple isolated services to be running in a single shared + * isolated process. + * + * The shared isolated process instance is identified by the instanceName + * parameter in {@link #bindIsolatedService(Intent, int, String, Executor, ServiceConnection)}. + * + * Subsequent calls to {@link #bindIsolatedService} with the same instanceName + * will cause the isolated service to be co-located in the same shared isolated process. + * + * Note that the shared isolated process is scoped to the calling app; once created, only + * the calling app can bind additional isolated services into the shared process. + */ + public static final int BIND_SHARED_ISOLATED_PROCESS = 0x00002000; + /*********** Public flags above this line ***********/ /*********** Hidden flags below this line ***********/ diff --git a/core/java/android/content/pm/ServiceInfo.java b/core/java/android/content/pm/ServiceInfo.java index 6453ab0b89649..4ade8a8b87b65 100644 --- a/core/java/android/content/pm/ServiceInfo.java +++ b/core/java/android/content/pm/ServiceInfo.java @@ -78,6 +78,20 @@ public class ServiceInfo extends ComponentInfo */ public static final int FLAG_USE_APP_ZYGOTE = 0x0008; + /** + * Bit in {@link #flags}: If set, and this is an {@link android.R.attr#isolatedProcess} + * service, the service is allowed to be bound in a shared isolated process with other + * isolated services. Note that these other isolated services can also belong to other + * apps from different vendors. + * + * Shared isolated processes are created when using the + * {@link android.content.Context#BIND_SHARED_ISOLATED_PROCESS) during service binding. + * + * Note that when this flag is used, the {@link android.R.attr#process} attribute is + * ignored when the process is bound into a shared isolated process by a client. + */ + public static final int FLAG_ALLOW_SHARED_ISOLATED_PROCESS = 0x0010; + /** * Bit in {@link #flags} indicating if the service is visible to ephemeral applications. * @hide diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index d4644c59fa529..44f85dad95210 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -2963,6 +2963,18 @@ Context.createAttributionContext() using the first attribution tag contained here. --> + +