From 95dd53bb5fc8f506e40cc88b1f0eb926bc50c7a5 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Thu, 23 Jul 2020 21:22:18 +0000 Subject: [PATCH] Allow module libs to use VINTF AIDL. Currently a native APEX can get and use a VINTF AIDL. However, this can't be passed over JNI to be used by Java code. This does not open VINTF AIDLs to any type of apps, where AIDL as an API is completely disallowed. Also, no Java ServiceManager APIs are available, and they couldn't be until b/139325468 is fixed. Bug: 161501127 Test: atest binderVendorDoubleLoadTest Change-Id: I1ab977248b1c39a7d08e0ca34389a7ba168c05b0 --- api/module-lib-current.txt | 4 ++++ core/java/android/os/Binder.java | 14 ++++++++------ non-updatable-api/module-lib-current.txt | 4 ++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/api/module-lib-current.txt b/api/module-lib-current.txt index 6f5ac7cb0c5a0..e77d750cbffbb 100644 --- a/api/module-lib-current.txt +++ b/api/module-lib-current.txt @@ -41,6 +41,10 @@ package android.net { package android.os { + public class Binder implements android.os.IBinder { + method public final void markVintfStability(); + } + public class StatsFrameworkInitializer { method public static void registerServiceWrappers(); method public static void setStatsServiceManager(@NonNull android.os.StatsServiceManager); diff --git a/core/java/android/os/Binder.java b/core/java/android/os/Binder.java index 947b77399e40c..f3a11ed6af1ce 100644 --- a/core/java/android/os/Binder.java +++ b/core/java/android/os/Binder.java @@ -529,15 +529,17 @@ public class Binder implements IBinder { /** * Mark as being built with VINTF-level stability promise. This API should - * only ever be invoked by the build system. It means that the interface - * represented by this binder is guaranteed to be kept stable for several - * years, and the build system also keeps snapshots of these APIs and - * invokes the AIDL compiler to make sure that these snapshots are - * backwards compatible. Instead of using this API, use an @VintfStability - * interface. + * only ever be invoked by generated code from the aidl compiler. It means + * that the interface represented by this binder is guaranteed to be kept + * stable for several years, according to the VINTF compatibility lifecycle, + * and the build system also keeps snapshots of these APIs and invokes the + * AIDL compiler to make sure that these snapshots are backwards compatible. + * Instead of using this API, use the @VintfStability annotation on your + * AIDL interface. * * @hide */ + @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) public final native void markVintfStability(); /** diff --git a/non-updatable-api/module-lib-current.txt b/non-updatable-api/module-lib-current.txt index 5d8a9cf75ea50..116549d2c24b5 100644 --- a/non-updatable-api/module-lib-current.txt +++ b/non-updatable-api/module-lib-current.txt @@ -1,6 +1,10 @@ // Signature format: 2.0 package android.os { + public class Binder implements android.os.IBinder { + method public final void markVintfStability(); + } + public class StatsServiceManager { method @NonNull public android.os.StatsServiceManager.ServiceRegisterer getStatsCompanionServiceRegisterer(); method @NonNull public android.os.StatsServiceManager.ServiceRegisterer getStatsManagerServiceRegisterer();