From 3e776b9e0427b1533f61ce9b2ac895cf8619d21c Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Tue, 7 Mar 2023 17:16:33 +0000 Subject: [PATCH] Revert "Revert "vib example client on product"" This reverts commit 29254e1e2310b9114c68d0b0e25a2989f7d4c0ae. It includes a fix for product apps for the targets without PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE=true. Reason for revert: reland from partner questions with a fix Bug: b/271988499 # asked again Test: TARGET_PRODUCT=ndk build/soong/soong_ui.bash --make-mode --soong-only out/soong/ndk.timestamp Change-Id: I066eb75274c291cf832ad9847c0a4623af797f41 --- .../Android.bp | 24 +++++++++++++++++-- .../AndroidManifest.xml | 0 .../example/vib/MyActivity.java | 0 .../getter.cpp | 0 .../jarjar.txt | 0 5 files changed, 22 insertions(+), 2 deletions(-) rename vibrator/aidl/default/{example_vendor_java_client => example_java_client}/Android.bp (53%) rename vibrator/aidl/default/{example_vendor_java_client => example_java_client}/AndroidManifest.xml (100%) rename vibrator/aidl/default/{example_vendor_java_client => example_java_client}/example/vib/MyActivity.java (100%) rename vibrator/aidl/default/{example_vendor_java_client => example_java_client}/getter.cpp (100%) rename vibrator/aidl/default/{example_vendor_java_client => example_java_client}/jarjar.txt (100%) diff --git a/vibrator/aidl/default/example_vendor_java_client/Android.bp b/vibrator/aidl/default/example_java_client/Android.bp similarity index 53% rename from vibrator/aidl/default/example_vendor_java_client/Android.bp rename to vibrator/aidl/default/example_java_client/Android.bp index f615cb1579..17a649cd1d 100644 --- a/vibrator/aidl/default/example_vendor_java_client/Android.bp +++ b/vibrator/aidl/default/example_java_client/Android.bp @@ -10,7 +10,8 @@ package { cc_library { name: "libexample_vib_getter", srcs: ["getter.cpp"], - vendor: true, + product_available: true, + vendor_available: true, shared_libs: [ "liblog", "libbinder_ndk", @@ -22,13 +23,32 @@ cc_library { android_app { name: "ExampleVibratorJavaVendorClient", - privileged: true, vendor: true, static_libs: ["android.hardware.vibrator-V1-java"], jni_libs: ["libexample_vib_getter"], + use_embedded_native_libs: true, jarjar_rules: "jarjar.txt", stl: "c++_shared", srcs: ["example/vib/MyActivity.java"], sdk_version: "system_current", visibility: [":__subpackages__"], } + +android_app { + name: "ExampleVibratorJavaProductClient", + product_specific: true, + static_libs: ["android.hardware.vibrator-V1-java"], + jni_libs: ["libexample_vib_getter"], + use_embedded_native_libs: true, + jarjar_rules: "jarjar.txt", + stl: "c++_shared", + srcs: ["example/vib/MyActivity.java"], + sdk_version: "system_current", + visibility: [":__subpackages__"], + // If PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE is not true, product apps + // may use unstable APIs. jni_uses_platform_apis must set to use the + // non-SDK jni libs in this case. + // This is not required if PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE is + // set to true. + jni_uses_platform_apis: true, +} diff --git a/vibrator/aidl/default/example_vendor_java_client/AndroidManifest.xml b/vibrator/aidl/default/example_java_client/AndroidManifest.xml similarity index 100% rename from vibrator/aidl/default/example_vendor_java_client/AndroidManifest.xml rename to vibrator/aidl/default/example_java_client/AndroidManifest.xml diff --git a/vibrator/aidl/default/example_vendor_java_client/example/vib/MyActivity.java b/vibrator/aidl/default/example_java_client/example/vib/MyActivity.java similarity index 100% rename from vibrator/aidl/default/example_vendor_java_client/example/vib/MyActivity.java rename to vibrator/aidl/default/example_java_client/example/vib/MyActivity.java diff --git a/vibrator/aidl/default/example_vendor_java_client/getter.cpp b/vibrator/aidl/default/example_java_client/getter.cpp similarity index 100% rename from vibrator/aidl/default/example_vendor_java_client/getter.cpp rename to vibrator/aidl/default/example_java_client/getter.cpp diff --git a/vibrator/aidl/default/example_vendor_java_client/jarjar.txt b/vibrator/aidl/default/example_java_client/jarjar.txt similarity index 100% rename from vibrator/aidl/default/example_vendor_java_client/jarjar.txt rename to vibrator/aidl/default/example_java_client/jarjar.txt