diff options
32 files changed, 187 insertions, 121 deletions
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp index dc27467f93..408b926ea7 100644 --- a/cmds/dumpstate/dumpstate.cpp +++ b/cmds/dumpstate/dumpstate.cpp @@ -1034,8 +1034,6 @@ static void DoLogcat() { CommandOptions::WithTimeoutInMs(timeout_ms).Build(), true /* verbose_duration */); DoRadioLogcat(); - RunCommand("LOG STATISTICS", {"logcat", "-b", "all", "-S"}); - /* kernels must set CONFIG_PSTORE_PMSG, slice up pstore with device tree */ RunCommand("LAST LOGCAT", {"logcat", "-L", "-b", "all", "-v", "threadtime", "-v", "printable", "-v", "uid", "-d", "*:v"}); @@ -1236,7 +1234,7 @@ static void DumpPacketStats() { static void DumpIpAddrAndRules() { /* The following have a tendency to get wedged when wifi drivers/fw goes belly-up. */ - RunCommand("NETWORK INTERFACES", {"ip", "link"}); + RunCommand("NETWORK INTERFACES", {"ip", "-s", "link"}); RunCommand("IPv4 ADDRESSES", {"ip", "-4", "addr", "show"}); RunCommand("IPv6 ADDRESSES", {"ip", "-6", "addr", "show"}); RunCommand("IP RULES", {"ip", "rule", "show"}); diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp index 1347450a77..cad77874fd 100644 --- a/cmds/installd/InstalldNativeService.cpp +++ b/cmds/installd/InstalldNativeService.cpp @@ -40,6 +40,7 @@ #include <fstream> #include <functional> #include <regex> +#include <thread> #include <unordered_set> #include <android-base/file.h> @@ -556,19 +557,33 @@ static int restorecon_app_data_lazy(const std::string& path, const std::string& // If the initial top-level restorecon above changed the label, then go // back and restorecon everything recursively if (inProgress || before != after) { - ScopedTrace tracer("label-change"); if (existing) { LOG(DEBUG) << "Detected label change from " << before << " to " << after << " at " - << path << "; running recursive restorecon"; + << path << "; running recursive restorecon"; } - // Temporary mark the folder as "in-progress" to resume in case of reboot/other failure. - RestoreconInProgress fence(path); + auto restorecon = [path, seInfo, uid]() { + ScopedTrace tracer("label-change"); - if (selinux_android_restorecon_pkgdir(path.c_str(), seInfo.c_str(), uid, - SELINUX_ANDROID_RESTORECON_RECURSE) < 0) { - PLOG(ERROR) << "Failed recursive restorecon for " << path; - return -1; + // Temporary mark the folder as "in-progress" to resume in case of reboot/other failure. + RestoreconInProgress fence(path); + + if (selinux_android_restorecon_pkgdir(path.c_str(), seInfo.c_str(), uid, + SELINUX_ANDROID_RESTORECON_RECURSE) < 0) { + PLOG(ERROR) << "Failed recursive restorecon for " << path; + return -1; + } + return 0; + }; + if (inProgress) { + // The previous restorecon was interrupted. It's either crashed (unlikely), or the phone + // was rebooted. Possibly because it took too much time. This time let's move it to a + // separate thread - so it won't block the rest of the OS. + std::thread(restorecon).detach(); + } else { + if (int result = restorecon(); result) { + return result; + } } } diff --git a/cmds/lshal/Timeout.h b/cmds/lshal/Timeout.h index e8d22d9b58..012a5d54aa 100644 --- a/cmds/lshal/Timeout.h +++ b/cmds/lshal/Timeout.h @@ -72,10 +72,14 @@ bool timeout(std::chrono::duration<R, P> delay, std::function<void(void)> &&func return false; } bool success = state.wait(now + delay); - if (!success) { - pthread_kill(thread, SIGINT); + if (success) { + pthread_join(thread, nullptr); + } else { + // b/311143089: Abandon this background thread. Resources for a detached + // thread are cleaned up when it is terminated. If the background thread + // is stalled, it will be terminated when returning from main(). + pthread_detach(thread); } - pthread_join(thread, nullptr); return success; } diff --git a/cmds/lshal/main.cpp b/cmds/lshal/main.cpp index 366c9383a2..a44f467bb1 100644 --- a/cmds/lshal/main.cpp +++ b/cmds/lshal/main.cpp @@ -18,5 +18,6 @@ int main(int argc, char **argv) { using namespace ::android::lshal; + // Background pthreads from timeout() are destroyed upon returning from main(). return Lshal{}.main(Arg{argc, argv}); } diff --git a/libs/binder/Android.bp b/libs/binder/Android.bp index eccd5dbc3a..11e81206d6 100644 --- a/libs/binder/Android.bp +++ b/libs/binder/Android.bp @@ -90,7 +90,6 @@ cc_defaults { "Stability.cpp", "Status.cpp", "TextOutput.cpp", - "Trace.cpp", "Utils.cpp", "file.cpp", ], @@ -251,7 +250,6 @@ cc_library_shared { srcs: [ // Trusty-specific files - "OS_android.cpp", "trusty/OS.cpp", "trusty/RpcServerTrusty.cpp", "trusty/RpcTransportTipcTrusty.cpp", @@ -581,11 +579,6 @@ cc_library { ], } -filegroup { - name: "libbinder_rpc_unstable_header", - srcs: ["include_rpc_unstable/binder_rpc_unstable.hpp"], -} - // libbinder historically contained additional interfaces that provided specific // functionality in the platform but have nothing to do with binder itself. These // are moved out of libbinder in order to avoid the overhead of their vtables. diff --git a/libs/binder/OS.h b/libs/binder/OS.h index c5f0730d6b..0035aeb205 100644 --- a/libs/binder/OS.h +++ b/libs/binder/OS.h @@ -24,6 +24,9 @@ namespace android::binder::os { +void trace_begin(uint64_t tag, const char* name); +void trace_end(uint64_t tag); + status_t setNonBlocking(borrowed_fd fd); status_t getRandomBytes(uint8_t* data, size_t size); diff --git a/libs/binder/OS_android.cpp b/libs/binder/OS_android.cpp index ad458eb705..1eace857fb 100644 --- a/libs/binder/OS_android.cpp +++ b/libs/binder/OS_android.cpp @@ -17,9 +17,11 @@ #include "OS.h" #include <android-base/threads.h> +#include <cutils/trace.h> #include <utils/misc.h> -namespace android::binder::os { +namespace android::binder { +namespace os { uint64_t GetThreadId() { #ifdef BINDER_RPC_SINGLE_THREADED @@ -34,4 +36,24 @@ bool report_sysprop_change() { return true; } -} // namespace android::binder::os +void trace_begin(uint64_t tag, const char* name) { + atrace_begin(tag, name); +} + +void trace_end(uint64_t tag) { + atrace_end(tag); +} + +} // namespace os + +// Legacy trace symbol. To be removed once all of downstream rebuilds. +void atrace_begin(uint64_t tag, const char* name) { + os::trace_begin(tag, name); +} + +// Legacy trace symbol. To be removed once all of downstream rebuilds. +void atrace_end(uint64_t tag) { + os::trace_end(tag); +} + +} // namespace android::binder diff --git a/libs/binder/Trace.cpp b/libs/binder/Trace.cpp deleted file mode 100644 index 1ebfa1a165..0000000000 --- a/libs/binder/Trace.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <binder/Trace.h> -#include <cutils/trace.h> - -namespace android { -namespace binder { - -void atrace_begin(uint64_t tag, const char* name) { - ::atrace_begin(tag, name); -} - -void atrace_end(uint64_t tag) { - ::atrace_end(tag); -} - -} // namespace binder -} // namespace android diff --git a/libs/binder/include/binder/Trace.h b/libs/binder/include/binder/Trace.h index 99378428ad..95318b2bf6 100644 --- a/libs/binder/include/binder/Trace.h +++ b/libs/binder/include/binder/Trace.h @@ -16,22 +16,36 @@ #pragma once -#include <cutils/trace.h> #include <stdint.h> +#if __has_include(<cutils/trace.h>) +#include <cutils/trace.h> +#endif + +#ifdef ATRACE_TAG_AIDL +#if ATRACE_TAG_AIDL != (1 << 24) +#error "Mismatched ATRACE_TAG_AIDL definitions" +#endif +#else +#define ATRACE_TAG_AIDL (1 << 24) +#endif + namespace android { namespace binder { +// Forward declarations from internal OS.h +namespace os { // Trampoline functions allowing generated aidls to trace binder transactions without depending on // libcutils/libutils -void atrace_begin(uint64_t tag, const char* name); -void atrace_end(uint64_t tag); +void trace_begin(uint64_t tag, const char* name); +void trace_end(uint64_t tag); +} // namespace os class ScopedTrace { public: - inline ScopedTrace(uint64_t tag, const char* name) : mTag(tag) { atrace_begin(mTag, name); } + inline ScopedTrace(uint64_t tag, const char* name) : mTag(tag) { os::trace_begin(mTag, name); } - inline ~ScopedTrace() { atrace_end(mTag); } + inline ~ScopedTrace() { os::trace_end(mTag); } private: uint64_t mTag; diff --git a/libs/binder/ndk/Android.bp b/libs/binder/ndk/Android.bp index 47b9f5868d..ccf3ce891f 100644 --- a/libs/binder/ndk/Android.bp +++ b/libs/binder/ndk/Android.bp @@ -139,6 +139,7 @@ cc_library { "performance*", "portability*", ], + afdo: true, } cc_library_headers { diff --git a/libs/binder/rust/rpcbinder/Android.bp b/libs/binder/rust/rpcbinder/Android.bp index 788abc4617..535ce010f7 100644 --- a/libs/binder/rust/rpcbinder/Android.bp +++ b/libs/binder/rust/rpcbinder/Android.bp @@ -70,7 +70,7 @@ rust_library { // TODO(b/184872979): remove once the RPC Binder API is stabilised. rust_bindgen { name: "libbinder_rpc_unstable_bindgen", - wrapper_src: ":libbinder_rpc_unstable_header", + wrapper_src: "BinderBindings.hpp", crate_name: "binder_rpc_unstable_bindgen", visibility: [":__subpackages__"], source_stem: "bindings", diff --git a/libs/binder/rust/rpcbinder/BinderBindings.hpp b/libs/binder/rust/rpcbinder/BinderBindings.hpp new file mode 100644 index 0000000000..7feb9650fd --- /dev/null +++ b/libs/binder/rust/rpcbinder/BinderBindings.hpp @@ -0,0 +1 @@ +#include <binder_rpc_unstable.hpp> diff --git a/libs/binder/rust/src/binder.rs b/libs/binder/rust/src/binder.rs index 6d122c5388..e34d31e58f 100644 --- a/libs/binder/rust/src/binder.rs +++ b/libs/binder/rust/src/binder.rs @@ -30,8 +30,8 @@ use std::fmt; use std::io::Write; use std::marker::PhantomData; use std::ops::Deref; +use std::os::fd::AsRawFd; use std::os::raw::c_char; -use std::os::unix::io::AsRawFd; use std::ptr; /// Binder action to perform. diff --git a/libs/binder/rust/src/lib.rs b/libs/binder/rust/src/lib.rs index ed870b6d8c..7f9348d913 100644 --- a/libs/binder/rust/src/lib.rs +++ b/libs/binder/rust/src/lib.rs @@ -100,6 +100,7 @@ mod error; mod native; mod parcel; mod proxy; +#[cfg(not(target_os = "trusty"))] mod state; use binder_ndk_sys as sys; @@ -116,6 +117,7 @@ pub use proxy::{ get_declared_instances, get_interface, get_service, is_declared, wait_for_interface, wait_for_service, DeathRecipient, SpIBinder, WpIBinder, }; +#[cfg(not(target_os = "trusty"))] pub use state::{ProcessState, ThreadState}; /// Binder result containing a [`Status`] on error. diff --git a/libs/binder/rust/src/native.rs b/libs/binder/rust/src/native.rs index b250012801..8ae010ea88 100644 --- a/libs/binder/rust/src/native.rs +++ b/libs/binder/rust/src/native.rs @@ -24,13 +24,10 @@ use crate::sys; use std::convert::TryFrom; use std::ffi::{c_void, CStr, CString}; -use std::fs::File; use std::io::Write; use std::mem::ManuallyDrop; use std::ops::Deref; use std::os::raw::c_char; -use std::os::unix::io::FromRawFd; -use std::slice; use std::sync::Mutex; /// Rust wrapper around Binder remotable objects. @@ -331,6 +328,7 @@ impl<T: Remotable> InterfaceClassMethods for Binder<T> { /// contains a `T` pointer in its user data. fd should be a non-owned file /// descriptor, and args must be an array of null-terminated string /// pointers with length num_args. + #[cfg(not(target_os = "trusty"))] unsafe extern "C" fn on_dump( binder: *mut sys::AIBinder, fd: i32, @@ -340,9 +338,10 @@ impl<T: Remotable> InterfaceClassMethods for Binder<T> { if fd < 0 { return StatusCode::UNEXPECTED_NULL as status_t; } + use std::os::fd::FromRawFd; // Safety: Our caller promised that fd is a file descriptor. We don't // own this file descriptor, so we need to be careful not to drop it. - let mut file = unsafe { ManuallyDrop::new(File::from_raw_fd(fd)) }; + let mut file = unsafe { ManuallyDrop::new(std::fs::File::from_raw_fd(fd)) }; if args.is_null() && num_args != 0 { return StatusCode::UNEXPECTED_NULL as status_t; @@ -354,7 +353,7 @@ impl<T: Remotable> InterfaceClassMethods for Binder<T> { // Safety: Our caller promised that `args` is an array of // null-terminated string pointers with length `num_args`. unsafe { - slice::from_raw_parts(args, num_args as usize) + std::slice::from_raw_parts(args, num_args as usize) .iter() .map(|s| CStr::from_ptr(*s)) .collect() @@ -374,6 +373,19 @@ impl<T: Remotable> InterfaceClassMethods for Binder<T> { Err(e) => e as status_t, } } + + /// Called to handle the `dump` transaction. + #[cfg(target_os = "trusty")] + unsafe extern "C" fn on_dump( + _binder: *mut sys::AIBinder, + _fd: i32, + _args: *mut *const c_char, + _num_args: u32, + ) -> status_t { + // This operation is not supported on Trusty right now + // because we do not have a uniform way of writing to handles + StatusCode::INVALID_OPERATION as status_t + } } impl<T: Remotable> Drop for Binder<T> { diff --git a/libs/binder/rust/src/proxy.rs b/libs/binder/rust/src/proxy.rs index dad3379bdc..7434e9ddbd 100644 --- a/libs/binder/rust/src/proxy.rs +++ b/libs/binder/rust/src/proxy.rs @@ -32,8 +32,8 @@ use std::convert::TryInto; use std::ffi::{c_void, CStr, CString}; use std::fmt; use std::mem; +use std::os::fd::AsRawFd; use std::os::raw::c_char; -use std::os::unix::io::AsRawFd; use std::ptr; use std::sync::Arc; diff --git a/libs/binder/tests/Android.bp b/libs/binder/tests/Android.bp index ba8fb39438..e4d4de86bc 100644 --- a/libs/binder/tests/Android.bp +++ b/libs/binder/tests/Android.bp @@ -134,6 +134,10 @@ aidl_interface { "IBinderRpcTest.aidl", "ParcelableCertificateData.aidl", ], + flags: [ + "-Werror", + "-Wno-mixed-oneway", + ], backend: { java: { enabled: false, diff --git a/libs/binder/tests/parcel_fuzzer/Android.bp b/libs/binder/tests/parcel_fuzzer/Android.bp index fe79f8ebe9..83db6c9b6d 100644 --- a/libs/binder/tests/parcel_fuzzer/Android.bp +++ b/libs/binder/tests/parcel_fuzzer/Android.bp @@ -16,6 +16,9 @@ aidl_interface { "parcelables/SingleDataParcelable.aidl", "parcelables/GenericDataParcelable.aidl", ], + flags: [ + "-Werror", + ], backend: { java: { enabled: true, diff --git a/libs/binder/tests/parcel_fuzzer/parcelables/GenericDataParcelable.aidl b/libs/binder/tests/parcel_fuzzer/parcelables/GenericDataParcelable.aidl index dd08f72470..9884dbb1af 100644 --- a/libs/binder/tests/parcel_fuzzer/parcelables/GenericDataParcelable.aidl +++ b/libs/binder/tests/parcel_fuzzer/parcelables/GenericDataParcelable.aidl @@ -17,7 +17,7 @@ package parcelables; parcelable GenericDataParcelable { enum JustSomeEnum { - SOME_ENUMERATOR, + ONE_ENUMERATOR, ANOTHER_ENUMERATOR, MAYBE_ONE_MORE_ENUMERATOR, } diff --git a/libs/binder/trusty/OS.cpp b/libs/binder/trusty/OS.cpp index ca14286d74..99da1ebc6d 100644 --- a/libs/binder/trusty/OS.cpp +++ b/libs/binder/trusty/OS.cpp @@ -31,6 +31,18 @@ using android::binder::unique_fd; namespace android::binder::os { +void trace_begin(uint64_t, const char*) {} + +void trace_end(uint64_t) {} + +uint64_t GetThreadId() { + return 0; +} + +bool report_sysprop_change() { + return false; +} + status_t setNonBlocking(borrowed_fd /*fd*/) { // Trusty IPC syscalls are all non-blocking by default. return OK; diff --git a/libs/binder/trusty/kernel/rules.mk b/libs/binder/trusty/kernel/rules.mk index d2b37aa8f6..69737fa102 100644 --- a/libs/binder/trusty/kernel/rules.mk +++ b/libs/binder/trusty/kernel/rules.mk @@ -24,13 +24,13 @@ LIBUTILS_DIR := system/core/libutils FMTLIB_DIR := external/fmtlib MODULE_SRCS := \ + $(LOCAL_DIR)/../OS.cpp \ $(LOCAL_DIR)/../TrustyStatus.cpp \ $(LIBBINDER_DIR)/Binder.cpp \ $(LIBBINDER_DIR)/BpBinder.cpp \ $(LIBBINDER_DIR)/FdTrigger.cpp \ $(LIBBINDER_DIR)/IInterface.cpp \ $(LIBBINDER_DIR)/IResultReceiver.cpp \ - $(LIBBINDER_DIR)/OS_android.cpp \ $(LIBBINDER_DIR)/Parcel.cpp \ $(LIBBINDER_DIR)/Stability.cpp \ $(LIBBINDER_DIR)/Status.cpp \ diff --git a/libs/binder/trusty/rules.mk b/libs/binder/trusty/rules.mk index dbddbe16e2..96c66a8be4 100644 --- a/libs/binder/trusty/rules.mk +++ b/libs/binder/trusty/rules.mk @@ -34,7 +34,6 @@ MODULE_SRCS := \ $(LIBBINDER_DIR)/FdTrigger.cpp \ $(LIBBINDER_DIR)/IInterface.cpp \ $(LIBBINDER_DIR)/IResultReceiver.cpp \ - $(LIBBINDER_DIR)/OS_android.cpp \ $(LIBBINDER_DIR)/Parcel.cpp \ $(LIBBINDER_DIR)/ParcelFileDescriptor.cpp \ $(LIBBINDER_DIR)/RpcServer.cpp \ diff --git a/libs/binder/trusty/rust/rules.mk b/libs/binder/trusty/rust/rules.mk new file mode 100644 index 0000000000..be90df3147 --- /dev/null +++ b/libs/binder/trusty/rust/rules.mk @@ -0,0 +1,37 @@ +# Copyright (C) 2023 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +LOCAL_DIR := $(GET_LOCAL_DIR) +LIBBINDER_DIR := $(LOCAL_DIR)/../.. + +MODULE := $(LOCAL_DIR) + +MODULE_SRCS := $(LIBBINDER_DIR)/rust/src/lib.rs + +MODULE_CRATE_NAME := binder + +MODULE_LIBRARY_DEPS += \ + $(LIBBINDER_DIR)/trusty \ + $(LIBBINDER_DIR)/trusty/ndk \ + $(LIBBINDER_DIR)/trusty/rust/binder_ndk_sys \ + external/rust/crates/downcast-rs \ + trusty/user/base/lib/trusty-sys \ + +# Trusty does not have `ProcessState`, so there are a few +# doc links in `IBinder` that are still broken. +MODULE_RUSTFLAGS += \ + --allow rustdoc::broken-intra-doc-links \ + +include make/library.mk diff --git a/libs/gui/include/gui/view/Surface.h b/libs/gui/include/gui/view/Surface.h index f7dcbc698d..b7aba2b9dc 100644 --- a/libs/gui/include/gui/view/Surface.h +++ b/libs/gui/include/gui/view/Surface.h @@ -24,9 +24,9 @@ #include <binder/IBinder.h> #include <binder/Parcelable.h> -namespace android { +#include <gui/IGraphicBufferProducer.h> -class IGraphicBufferProducer; +namespace android { namespace view { diff --git a/libs/gui/view/Surface.cpp b/libs/gui/view/Surface.cpp index 198908d334..7c15e7cf92 100644 --- a/libs/gui/view/Surface.cpp +++ b/libs/gui/view/Surface.cpp @@ -20,7 +20,6 @@ #include <android/binder_parcel.h> #include <android/native_window.h> #include <binder/Parcel.h> -#include <gui/IGraphicBufferProducer.h> #include <gui/Surface.h> #include <gui/view/Surface.h> #include <system/window.h> diff --git a/libs/renderengine/skia/AutoBackendTexture.cpp b/libs/renderengine/skia/AutoBackendTexture.cpp index c412c9cff7..daa42c32b6 100644 --- a/libs/renderengine/skia/AutoBackendTexture.cpp +++ b/libs/renderengine/skia/AutoBackendTexture.cpp @@ -91,9 +91,9 @@ void logFatalTexture(const char* msg, const GrBackendTexture& tex, ui::Dataspace LOG_ALWAYS_FATAL("%s isTextureValid:%d dataspace:%d" "\n\tGrBackendTexture: (%i x %i) hasMipmaps: %i isProtected: %i texType: %i" "\n\t\tGrGLTextureInfo: success: %i fTarget: %u fFormat: %u colorType %i", - msg, tex.isValid(), dataspace, tex.width(), tex.height(), tex.hasMipmaps(), - tex.isProtected(), static_cast<int>(tex.textureType()), retrievedTextureInfo, - textureInfo.fTarget, textureInfo.fFormat, colorType); + msg, tex.isValid(), static_cast<int32_t>(dataspace), tex.width(), tex.height(), + tex.hasMipmaps(), tex.isProtected(), static_cast<int>(tex.textureType()), + retrievedTextureInfo, textureInfo.fTarget, textureInfo.fFormat, colorType); } sk_sp<SkImage> AutoBackendTexture::makeImage(ui::Dataspace dataspace, SkAlphaType alphaType, diff --git a/libs/ui/Gralloc4.cpp b/libs/ui/Gralloc4.cpp index b6274ab9c0..03ff58a76c 100644 --- a/libs/ui/Gralloc4.cpp +++ b/libs/ui/Gralloc4.cpp @@ -468,8 +468,8 @@ status_t Gralloc4Mapper::isSupported(uint32_t width, uint32_t height, PixelForma uint32_t layerCount, uint64_t usage, bool* outSupported) const { IMapper::BufferDescriptorInfo descriptorInfo; - if (auto error = sBufferDescriptorInfo("isSupported", width, height, format, layerCount, usage, - &descriptorInfo) != OK) { + if (sBufferDescriptorInfo("isSupported", width, height, format, layerCount, usage, + &descriptorInfo) != OK) { // Usage isn't known to the HAL or otherwise failed validation. *outSupported = false; return OK; diff --git a/libs/ultrahdr/Android.bp b/libs/ultrahdr/Android.bp index 9deba01dc8..eda5ea4578 100644 --- a/libs/ultrahdr/Android.bp +++ b/libs/ultrahdr/Android.bp @@ -21,7 +21,8 @@ package { } cc_library { - name: "libultrahdr", + name: "libultrahdr-deprecated", + enabled: false, host_supported: true, vendor_available: true, export_include_dirs: ["include"], @@ -46,7 +47,8 @@ cc_library { } cc_library { - name: "libjpegencoder", + name: "libjpegencoder-deprecated", + enabled: false, host_supported: true, vendor_available: true, @@ -64,7 +66,8 @@ cc_library { } cc_library { - name: "libjpegdecoder", + name: "libjpegdecoder-deprecated", + enabled: false, host_supported: true, vendor_available: true, diff --git a/libs/ultrahdr/adobe-hdr-gain-map-license/Android.bp b/libs/ultrahdr/adobe-hdr-gain-map-license/Android.bp index e999a8bd28..2fa361f0b7 100644 --- a/libs/ultrahdr/adobe-hdr-gain-map-license/Android.bp +++ b/libs/ultrahdr/adobe-hdr-gain-map-license/Android.bp @@ -13,7 +13,7 @@ // limitations under the License. license { - name: "adobe_hdr_gain_map_license", + name: "adobe_hdr_gain_map_license-deprecated", license_kinds: ["legacy_by_exception_only"], license_text: ["NOTICE"], } diff --git a/libs/ultrahdr/fuzzer/Android.bp b/libs/ultrahdr/fuzzer/Android.bp index 6c0a2f577c..8d9132fd4d 100644 --- a/libs/ultrahdr/fuzzer/Android.bp +++ b/libs/ultrahdr/fuzzer/Android.bp @@ -22,7 +22,8 @@ package { } cc_defaults { - name: "ultrahdr_fuzzer_defaults", + name: "ultrahdr_fuzzer_defaults-deprecated", + enabled: false, host_supported: true, shared_libs: [ "libimage_io", @@ -53,7 +54,8 @@ cc_defaults { } cc_fuzz { - name: "ultrahdr_enc_fuzzer", + name: "ultrahdr_enc_fuzzer-deprecated", + enabled: false, defaults: ["ultrahdr_fuzzer_defaults"], srcs: [ "ultrahdr_enc_fuzzer.cpp", @@ -61,7 +63,8 @@ cc_fuzz { } cc_fuzz { - name: "ultrahdr_dec_fuzzer", + name: "ultrahdr_dec_fuzzer-deprecated", + enabled: false, defaults: ["ultrahdr_fuzzer_defaults"], srcs: [ "ultrahdr_dec_fuzzer.cpp", diff --git a/libs/ultrahdr/tests/Android.bp b/libs/ultrahdr/tests/Android.bp index 594413018c..00cc797591 100644 --- a/libs/ultrahdr/tests/Android.bp +++ b/libs/ultrahdr/tests/Android.bp @@ -22,12 +22,15 @@ package { } cc_test { - name: "libultrahdr_test", + name: "ultrahdr_unit_test-deprecated", + enabled: false, test_suites: ["device-tests"], srcs: [ "gainmapmath_test.cpp", "icchelper_test.cpp", "jpegr_test.cpp", + "jpegencoderhelper_test.cpp", + "jpegdecoderhelper_test.cpp", ], shared_libs: [ "libimage_io", @@ -42,38 +45,7 @@ cc_test { "libultrahdr", "libutils", ], -} - -cc_test { - name: "libjpegencoderhelper_test", - test_suites: ["device-tests"], - srcs: [ - "jpegencoderhelper_test.cpp", - ], - shared_libs: [ - "libjpeg", - "liblog", - ], - static_libs: [ - "libgtest", - "libjpegencoder", - ], -} - -cc_test { - name: "libjpegdecoderhelper_test", - test_suites: ["device-tests"], - srcs: [ - "jpegdecoderhelper_test.cpp", - ], - shared_libs: [ - "libjpeg", - "liblog", - ], - static_libs: [ - "libgtest", - "libjpegdecoder", - "libultrahdr", - "libutils", + data: [ + "./data/*.*", ], } diff --git a/services/surfaceflinger/tests/unittests/SurfaceFlinger_DisplayTransactionCommitTest.cpp b/services/surfaceflinger/tests/unittests/SurfaceFlinger_DisplayTransactionCommitTest.cpp index 94d517a3c3..b620830357 100644 --- a/services/surfaceflinger/tests/unittests/SurfaceFlinger_DisplayTransactionCommitTest.cpp +++ b/services/surfaceflinger/tests/unittests/SurfaceFlinger_DisplayTransactionCommitTest.cpp @@ -110,7 +110,7 @@ void DisplayTransactionCommitTest::verifyDisplayIsConnected(const sp<IBinder>& d EXPECT_EQ(static_cast<bool>(Case::Display::PRIMARY), display.isPrimary()); std::optional<DisplayDeviceState::Physical> expectedPhysical; - if (const auto connectionType = Case::Display::CONNECTION_TYPE::value) { + if (Case::Display::CONNECTION_TYPE::value) { const auto displayId = PhysicalDisplayId::tryCast(Case::Display::DISPLAY_ID::get()); ASSERT_TRUE(displayId); const auto hwcDisplayId = Case::Display::HWC_DISPLAY_ID_OPT::value; |