Merge Android 24Q2 Release (ab/11526283) to aosp-main-future
Bug: 337098550
Merged-In: I97998b225edceb2f17203f56f40688c69ceb6934
Change-Id: I5a2f16da0e8c24f928236b4c29cfa508cee6cd3f
diff --git a/Android.bp b/Android.bp
index 00984ef..06959a0 100644
--- a/Android.bp
+++ b/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_kernel",
default_applicable_licenses: ["system_libhidl_license"],
}
@@ -104,10 +105,7 @@
"com.android.nfcservices",
"com.android.tethering",
],
- vndk: {
- enabled: true,
- support_system_process: true,
- },
+ double_loadable: true,
whole_static_libs: [
"libhwbinder-impl-internal",
],
@@ -127,6 +125,7 @@
"//hardware:__subpackages__",
"//test/sts:__subpackages__",
"//vendor:__subpackages__",
+ "//visibility:any_system_partition",
],
}
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 4e330d8..7193d26 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -23,6 +23,14 @@
},
{
"name": "hidl_test"
+ },
+ {
+ "name": "CtsOsTestCases",
+ "options": [
+ {
+ "include-filter": "android.os.cts.HwBinderTest"
+ }
+ ]
}
]
}
diff --git a/base/include/hidl/HidlSupport.h b/base/include/hidl/HidlSupport.h
index 1bb38e8..de01970 100644
--- a/base/include/hidl/HidlSupport.h
+++ b/base/include/hidl/HidlSupport.h
@@ -532,40 +532,35 @@
private:
// Define std interator interface for walking the array contents
template<bool is_const>
- class iter : public std::iterator<
- std::random_access_iterator_tag, /* Category */
- T,
- ptrdiff_t, /* Distance */
- typename std::conditional<is_const, const T *, T *>::type /* Pointer */,
- typename std::conditional<is_const, const T &, T &>::type /* Reference */>
- {
- using traits = std::iterator_traits<iter>;
- using ptr_type = typename traits::pointer;
- using ref_type = typename traits::reference;
- using diff_type = typename traits::difference_type;
+ class iter {
public:
- iter(ptr_type ptr) : mPtr(ptr) { }
+ using iterator_category = std::random_access_iterator_tag;
+ using value_type = T;
+ using difference_type = ptrdiff_t;
+ using pointer = std::conditional_t<is_const, const T *, T *>;
+ using reference = std::conditional_t<is_const, const T &, T &>;
+ iter(pointer ptr) : mPtr(ptr) { }
inline iter &operator++() { mPtr++; return *this; }
inline iter operator++(int) { iter i = *this; mPtr++; return i; }
inline iter &operator--() { mPtr--; return *this; }
inline iter operator--(int) { iter i = *this; mPtr--; return i; }
- inline friend iter operator+(diff_type n, const iter &it) { return it.mPtr + n; }
- inline iter operator+(diff_type n) const { return mPtr + n; }
- inline iter operator-(diff_type n) const { return mPtr - n; }
- inline diff_type operator-(const iter &other) const { return mPtr - other.mPtr; }
- inline iter &operator+=(diff_type n) { mPtr += n; return *this; }
- inline iter &operator-=(diff_type n) { mPtr -= n; return *this; }
- inline ref_type operator*() const { return *mPtr; }
- inline ptr_type operator->() const { return mPtr; }
+ inline friend iter operator+(difference_type n, const iter &it) { return it.mPtr + n; }
+ inline iter operator+(difference_type n) const { return mPtr + n; }
+ inline iter operator-(difference_type n) const { return mPtr - n; }
+ inline difference_type operator-(const iter &other) const { return mPtr - other.mPtr; }
+ inline iter &operator+=(difference_type n) { mPtr += n; return *this; }
+ inline iter &operator-=(difference_type n) { mPtr -= n; return *this; }
+ inline reference operator*() const { return *mPtr; }
+ inline pointer operator->() const { return mPtr; }
inline bool operator==(const iter &rhs) const { return mPtr == rhs.mPtr; }
inline bool operator!=(const iter &rhs) const { return mPtr != rhs.mPtr; }
inline bool operator< (const iter &rhs) const { return mPtr < rhs.mPtr; }
inline bool operator> (const iter &rhs) const { return mPtr > rhs.mPtr; }
inline bool operator<=(const iter &rhs) const { return mPtr <= rhs.mPtr; }
inline bool operator>=(const iter &rhs) const { return mPtr >= rhs.mPtr; }
- inline ref_type operator[](size_t n) const { return mPtr[n]; }
+ inline reference operator[](size_t n) const { return mPtr[n]; }
private:
- ptr_type mPtr;
+ pointer mPtr;
};
public:
using iterator = iter<false /* is_const */>;
diff --git a/fuzzer/Android.bp b/fuzzer/Android.bp
index 5f95ce7..3de7b74 100644
--- a/fuzzer/Android.bp
+++ b/fuzzer/Android.bp
@@ -14,6 +14,10 @@
* limitations under the License.
*/
+package {
+ default_team: "trendy_team_android_kernel",
+}
+
cc_defaults {
name: "libHidlBase_fuzzer_defaults",
host_supported: true,
@@ -38,7 +42,8 @@
},
fuzz_config: {
cc: [
- "android-media-fuzzing-reports@google.com",
+ "smoreland@google.com",
+ "elsk@google.com",
],
componentid: 155276,
hotlists: [
@@ -54,6 +59,6 @@
cc_fuzz {
name: "libHidlBase_parcel_fuzzer",
- srcs: ["libHidlBase_parcel_fuzzer.cpp",],
+ srcs: ["libHidlBase_parcel_fuzzer.cpp"],
defaults: ["libHidlBase_fuzzer_defaults"],
}
diff --git a/libhidlmemory/Android.bp b/libhidlmemory/Android.bp
index fc5770c..063cd8e 100644
--- a/libhidlmemory/Android.bp
+++ b/libhidlmemory/Android.bp
@@ -34,10 +34,7 @@
enabled: false,
},
},
- vndk: {
- enabled: true,
- support_system_process: true,
- },
+ double_loadable: true,
apex_available: [
"//apex_available:platform",
"com.android.neuralnetworks",
diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp
index 8867f53..b5e02df 100644
--- a/transport/ServiceManagement.cpp
+++ b/transport/ServiceManagement.cpp
@@ -45,6 +45,7 @@
#include <android-base/properties.h>
#include <android-base/stringprintf.h>
#include <android-base/strings.h>
+#include <hwbinder/HidlSupport.h>
#include <hwbinder/IPCThreadState.h>
#include <hwbinder/Parcel.h>
#if !defined(__ANDROID_RECOVERY__) && defined(__ANDROID__)
@@ -71,19 +72,8 @@
static constexpr bool kIsRecovery = false;
#endif
-static void waitForHwServiceManager() {
- // TODO(b/31559095): need bionic host so that we can use 'prop_info' returned
- // from WaitForProperty
-#ifdef __ANDROID__
- static const char* kHwServicemanagerReadyProperty = "hwservicemanager.ready";
-
- using std::literals::chrono_literals::operator""s;
-
- using android::base::WaitForProperty;
- while (!WaitForProperty(kHwServicemanagerReadyProperty, "true", 1s)) {
- LOG(WARNING) << "Waited for hwservicemanager.ready for a second, waiting another...";
- }
-#endif // __ANDROID__
+bool isHidlSupported() {
+ return isHwbinderSupportedBlocking();
}
static std::string binaryName() {
@@ -211,31 +201,6 @@
fqName == IServiceManager1_2::descriptor;
}
-static bool isHwServiceManagerInstalled() {
- return access("/system_ext/bin/hwservicemanager", F_OK) == 0 ||
- access("/system/system_ext/bin/hwservicemanager", F_OK) == 0 ||
- access("/system/bin/hwservicemanager", F_OK) == 0;
-}
-
-bool isHidlSupported() {
- if (!isHwServiceManagerInstalled()) {
- return false;
- }
-#ifdef __ANDROID__
- // TODO(b/218588089) remove this temporary support variable once Cuttlefish
- // (the only current Android V launching device) no longer requires HIDL.
- constexpr bool kTempHidlSupport = true;
- static const char* kVendorApiProperty = "ro.vendor.api_level";
- // HIDL and hwservicemanager are not supported in Android V+
- return android::base::GetIntProperty(kVendorApiProperty, 0) < __ANDROID_API_V__ ||
- kTempHidlSupport;
-#else
- // No access to properties and no requirement for dropping HIDL support if
- // this isn't Android
- return true;
-#endif // __ANDROID__
-}
-
/*
* A replacement for hwservicemanager when it is not installed on a device.
*
@@ -397,20 +362,18 @@
return gDefaultServiceManager;
}
- if (!isHidlSupported()) {
- // hwservicemanager is not available on this device.
- LOG(WARNING) << "hwservicemanager is not supported on the device.";
- gDefaultServiceManager = sp<NoHwServiceManager>::make();
- return gDefaultServiceManager;
- }
-
if (access("/dev/hwbinder", F_OK|R_OK|W_OK) != 0) {
// HwBinder not available on this device or not accessible to
// this process.
return nullptr;
}
- waitForHwServiceManager();
+ if (!isHidlSupported()) {
+ // hwservicemanager is not available on this device.
+ LOG(WARNING) << "hwservicemanager is not supported on the device.";
+ gDefaultServiceManager = sp<NoHwServiceManager>::make();
+ return gDefaultServiceManager;
+ }
while (gDefaultServiceManager == nullptr) {
gDefaultServiceManager =
diff --git a/transport/allocator/1.0/utils/Android.bp b/transport/allocator/1.0/utils/Android.bp
index f21047d..7ac7c01 100644
--- a/transport/allocator/1.0/utils/Android.bp
+++ b/transport/allocator/1.0/utils/Android.bp
@@ -24,9 +24,6 @@
cc_library {
name: "libhidlallocatorutils",
vendor_available: true,
- vndk: {
- enabled: true,
- },
double_loadable: true,
defaults: ["libhidl-defaults"],
shared_libs: [
diff --git a/transport/allocator/1.0/vts/functional/Android.bp b/transport/allocator/1.0/vts/functional/Android.bp
index f53fc4f..58047cb 100644
--- a/transport/allocator/1.0/vts/functional/Android.bp
+++ b/transport/allocator/1.0/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_kernel",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "system_libhidl_license"
@@ -33,5 +34,8 @@
static_libs: [
"android.hidl.allocator@1.0",
],
- test_suites: ["general-tests", "vts"],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
}
diff --git a/transport/base/1.0/vts/functional/Android.bp b/transport/base/1.0/vts/functional/Android.bp
index a2a3484..a5a7c33 100644
--- a/transport/base/1.0/vts/functional/Android.bp
+++ b/transport/base/1.0/vts/functional/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_kernel",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "system_libhidl_license"
diff --git a/transport/memory/1.0/Android.bp b/transport/memory/1.0/Android.bp
index 8e066a9..e1b03b2 100644
--- a/transport/memory/1.0/Android.bp
+++ b/transport/memory/1.0/Android.bp
@@ -14,10 +14,6 @@
root: "android.hidl",
// TODO(b/153609531): remove when no longer needed.
native_bridge_supported: true,
- vndk: {
- enabled: true,
- support_system_process: true,
- },
srcs: [
"IMapper.hal",
"IMemory.hal",
diff --git a/transport/memory/token/1.0/Android.bp b/transport/memory/token/1.0/Android.bp
index c304284..c7a099e 100644
--- a/transport/memory/token/1.0/Android.bp
+++ b/transport/memory/token/1.0/Android.bp
@@ -14,10 +14,6 @@
root: "android.hidl",
// TODO(b/153609531): remove when no longer needed.
native_bridge_supported: true,
- vndk: {
- enabled: true,
- support_system_process: true,
- },
srcs: [
"IMemoryToken.hal",
],
diff --git a/transport/safe_union/1.0/Android.bp b/transport/safe_union/1.0/Android.bp
index cae92dd..45c010f 100644
--- a/transport/safe_union/1.0/Android.bp
+++ b/transport/safe_union/1.0/Android.bp
@@ -12,10 +12,6 @@
hidl_interface {
name: "android.hidl.safe_union@1.0",
root: "android.hidl",
- vndk: {
- enabled: true,
- support_system_process: true,
- },
srcs: [
"types.hal",
],
diff --git a/transport/token/1.0/Android.bp b/transport/token/1.0/Android.bp
index 8bda482..88fd909 100644
--- a/transport/token/1.0/Android.bp
+++ b/transport/token/1.0/Android.bp
@@ -12,9 +12,6 @@
hidl_interface {
name: "android.hidl.token@1.0",
root: "android.hidl",
- vndk: {
- enabled: true,
- },
srcs: [
"ITokenManager.hal",
],
diff --git a/transport/token/1.0/utils/Android.bp b/transport/token/1.0/utils/Android.bp
index 84f6f0f..a58d730 100644
--- a/transport/token/1.0/utils/Android.bp
+++ b/transport/token/1.0/utils/Android.bp
@@ -32,9 +32,6 @@
enabled: false,
},
},
- vndk: {
- enabled: true,
- },
double_loadable: true,
srcs: [
diff --git a/vintfdata/Android.mk b/vintfdata/Android.mk
index 49e1733..ed8f506 100644
--- a/vintfdata/Android.mk
+++ b/vintfdata/Android.mk
@@ -28,17 +28,23 @@
endif
SYSTEM_EXT_MANIFEST_INPUT_FILES := $(LOCAL_PATH)/system_ext_manifest.default.xml
-ifdef SYSTEM_EXT_MANIFEST_FILES
- SYSTEM_EXT_MANIFEST_INPUT_FILES += $(SYSTEM_EXT_MANIFEST_FILES)
+
+ifeq ($(PRODUCT_HIDL_ENABLED),true)
+ifneq ($(filter hwservicemanager,$(PRODUCT_PACKAGES)),)
+SYSTEM_EXT_MANIFEST_INPUT_FILES += $(TOPDIR)system/hwservicemanager/hwservicemanager_no_max.xml
+else
+$(error If PRODUCT_HIDL_ENABLED is set, hwservicemanager must be added to PRODUCT_PACKAGES explicitly)
+endif
+else
+ifneq ($(filter hwservicemanager,$(PRODUCT_PACKAGES)),)
+SYSTEM_EXT_MANIFEST_INPUT_FILES += $(TOPDIR)system/hwservicemanager/hwservicemanager.xml
+else ifneq ($(filter hwservicemanager,$(PRODUCT_PACKAGES_SHIPPING_API_LEVEL_34)),)
+SYSTEM_EXT_MANIFEST_INPUT_FILES += $(TOPDIR)system/hwservicemanager/hwservicemanager.xml
+endif
endif
-# VNDK Version in device compatibility matrix and framework manifest
-ifeq ($(KEEP_VNDK),true)
-ifeq ($(BOARD_VNDK_VERSION),current)
-VINTF_VNDK_VERSION := $(PLATFORM_VNDK_VERSION)
-else
-VINTF_VNDK_VERSION := $(BOARD_VNDK_VERSION)
-endif
+ifdef SYSTEM_EXT_MANIFEST_FILES
+ SYSTEM_EXT_MANIFEST_INPUT_FILES += $(SYSTEM_EXT_MANIFEST_FILES)
endif
# Device Compatibility Matrix
@@ -59,31 +65,13 @@
GEN := $(local-generated-sources-dir)/compatibility_matrix.xml
-# VNDK is no longer a dependency for vendor version 35 and beyond
-$(GEN): PRIVATE_VINTF_VNDK_VERSION :=
-ifdef VINTF_VNDK_VERSION
-ifeq ($(call math_is_number,$(VINTF_VNDK_VERSION)),true)
-ifeq ($(call math_lt_or_eq,$(VINTF_VNDK_VERSION),34),true)
-$(GEN): PRIVATE_VINTF_VNDK_VERSION := $(VINTF_VNDK_VERSION)
-endif
-endif
-endif
$(GEN): PRIVATE_DEVICE_MATRIX_INPUT_FILE := $(DEVICE_MATRIX_INPUT_FILE)
-ifeq ($(PRIVATE_VINTF_VNDK_VERSION),)
$(GEN): $(DEVICE_MATRIX_INPUT_FILE) $(HOST_OUT_EXECUTABLES)/assemble_vintf
BOARD_SYSTEMSDK_VERSIONS="$(BOARD_SYSTEMSDK_VERSIONS)" \
$(HOST_OUT_EXECUTABLES)/assemble_vintf \
-i $(call normalize-path-list,$(PRIVATE_DEVICE_MATRIX_INPUT_FILE)) \
-o $@
-else
-$(GEN): $(DEVICE_MATRIX_INPUT_FILE) $(HOST_OUT_EXECUTABLES)/assemble_vintf
- REQUIRED_VNDK_VERSION=$(PRIVATE_VINTF_VNDK_VERSION) \
- BOARD_SYSTEMSDK_VERSIONS="$(BOARD_SYSTEMSDK_VERSIONS)" \
- $(HOST_OUT_EXECUTABLES)/assemble_vintf \
- -i $(call normalize-path-list,$(PRIVATE_DEVICE_MATRIX_INPUT_FILE)) \
- -o $@
-endif
LOCAL_PREBUILT_MODULE_FILE := $(GEN)
include $(BUILD_PREBUILT)
@@ -145,7 +133,7 @@
GEN := $(local-generated-sources-dir)/manifest.xml
$(GEN): PRIVATE_SYSTEM_EXT_MANIFEST_FILES := $(SYSTEM_EXT_MANIFEST_INPUT_FILES)
$(GEN): PRIVATE_PROVIDED_VNDK_VERSIONS := \
- $(sort $(VINTF_VNDK_VERSION) $(PRODUCT_EXTRA_VNDK_VERSIONS))
+ $(sort $(PRODUCT_EXTRA_VNDK_VERSIONS))
$(GEN): $(SYSTEM_EXT_MANIFEST_INPUT_FILES) $(HOST_OUT_EXECUTABLES)/assemble_vintf
PROVIDED_VNDK_VERSIONS="$(PRIVATE_PROVIDED_VNDK_VERSIONS)" \
@@ -156,7 +144,6 @@
LOCAL_PREBUILT_MODULE_FILE := $(GEN)
include $(BUILD_PREBUILT)
-VINTF_VNDK_VERSION :=
SYSTEM_MANIFEST_INPUT_FILES :=
SYSTEM_EXT_MANIFEST_INPUT_FILES :=
DEVICE_MATRIX_INPUT_FILE :=