diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-05-07 23:30:37 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-05-07 23:30:37 +0000 |
commit | 38fea70b60e02220d103a13fa26730b05b1c749a (patch) | |
tree | 6bba50383139e1e233d2f01ed020fff83a4e4687 | |
parent | c348a5ca5aaffe3af31903c422cf8589a6c66fdf (diff) | |
parent | a68d95c1f7e5fd244112779b5b23d56f8469bf74 (diff) | |
download | native-38fea70b60e02220d103a13fa26730b05b1c749a.tar.gz |
Merge "Snap for 11812660 from cf2f81a874c0936222e3d570efc06e77ed4f3a01 to sdk-release" into sdk-release
-rw-r--r-- | include/android/choreographer.h | 4 | ||||
-rw-r--r-- | include/android/looper.h | 5 | ||||
-rw-r--r-- | include/android/sensor.h | 5 | ||||
-rw-r--r-- | libs/binder/ndk/include_platform/android/binder_manager.h | 5 | ||||
-rw-r--r-- | libs/binder/trusty/ndk/include/android/llndk-versioning.h | 18 | ||||
-rw-r--r-- | libs/binder/trusty/ndk/include/sys/cdefs.h | 1 | ||||
-rw-r--r-- | libs/bufferstreams/Android.bp | 1 | ||||
-rw-r--r-- | libs/bufferstreams/aconfig/bufferstreams_flags.aconfig | 1 | ||||
-rw-r--r-- | libs/gui/Android.bp | 1 | ||||
-rw-r--r-- | libs/gui/libgui_flags.aconfig | 1 | ||||
-rw-r--r-- | libs/input/Android.bp | 1 | ||||
-rw-r--r-- | libs/input/input_flags.aconfig | 1 | ||||
-rw-r--r-- | services/gpuservice/GpuService.cpp | 3 | ||||
-rw-r--r-- | services/gpuservice/gpumem/GpuMem.cpp | 1 | ||||
-rw-r--r-- | services/gpuservice/gpumem/include/gpumem/GpuMem.h | 5 | ||||
-rw-r--r-- | services/gpuservice/gpuwork/GpuWork.cpp | 1 | ||||
-rw-r--r-- | services/gpuservice/gpuwork/include/gpuwork/GpuWork.h | 6 | ||||
-rw-r--r-- | services/surfaceflinger/Android.bp | 1 | ||||
-rw-r--r-- | services/surfaceflinger/surfaceflinger_flags.aconfig | 1 |
19 files changed, 50 insertions, 12 deletions
diff --git a/include/android/choreographer.h b/include/android/choreographer.h index f999708f04..c4d1ca65be 100644 --- a/include/android/choreographer.h +++ b/include/android/choreographer.h @@ -123,7 +123,7 @@ AChoreographer* AChoreographer_getInstance() __INTRODUCED_IN(24); */ void AChoreographer_postFrameCallback(AChoreographer* choreographer, AChoreographer_frameCallback callback, void* data) - __INTRODUCED_IN(24) __DEPRECATED_IN(29); + __INTRODUCED_IN(24) __DEPRECATED_IN(29, "Use AChoreographer_postFrameCallback64 instead"); /** * Deprecated: Use AChoreographer_postFrameCallbackDelayed64 instead. @@ -131,7 +131,7 @@ void AChoreographer_postFrameCallback(AChoreographer* choreographer, void AChoreographer_postFrameCallbackDelayed(AChoreographer* choreographer, AChoreographer_frameCallback callback, void* data, long delayMillis) __INTRODUCED_IN(24) - __DEPRECATED_IN(29); + __DEPRECATED_IN(29, "Use AChoreographer_postFrameCallbackDelayed64 instead"); /** * Post a callback to be run on the next frame. The data pointer provided will diff --git a/include/android/looper.h b/include/android/looper.h index e50730d5c1..6a02916fb3 100644 --- a/include/android/looper.h +++ b/include/android/looper.h @@ -35,7 +35,7 @@ extern "C" { // This file may also be built on glibc or on Windows/MacOS libc's, so // deprecated definitions are provided. #if !defined(__REMOVED_IN) -#define __REMOVED_IN(__api_level) __attribute__((__deprecated__)) +#define __REMOVED_IN(__api_level, msg) __attribute__((__deprecated__(msg))) #endif struct ALooper; @@ -213,7 +213,8 @@ int ALooper_pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outDa * Removed in API 34 as ALooper_pollAll can swallow ALooper_wake calls. * Use ALooper_pollOnce instead. */ -int ALooper_pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData) __REMOVED_IN(1); +int ALooper_pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData) + __REMOVED_IN(1, "ALooper_pollAll may ignore wakes. Use ALooper_pollOnce instead. See https://github.com/android/ndk/discussions/2020 for more information"); /** * Wakes the poll asynchronously. diff --git a/include/android/sensor.h b/include/android/sensor.h index a618393e66..e3c1ccfc6c 100644 --- a/include/android/sensor.h +++ b/include/android/sensor.h @@ -60,7 +60,7 @@ #define __INTRODUCED_IN(__api_level) /* nothing */ #endif #if !defined(__DEPRECATED_IN) -#define __DEPRECATED_IN(__api_level) __attribute__((__deprecated__)) +#define __DEPRECATED_IN(__api_level, msg) __attribute__((__deprecated__(msg))) #endif #ifdef __cplusplus @@ -748,7 +748,8 @@ typedef ASensorRef const* ASensorList; * ASensorManager* sensorManager = ASensorManager_getInstance(); * */ -ASensorManager* ASensorManager_getInstance() __DEPRECATED_IN(26); +ASensorManager* ASensorManager_getInstance() + __DEPRECATED_IN(26, "Use ASensorManager_getInstanceForPackage instead"); /** * Get a reference to the sensor manager. ASensorManager is a singleton diff --git a/libs/binder/ndk/include_platform/android/binder_manager.h b/libs/binder/ndk/include_platform/android/binder_manager.h index c665ad82ad..52edae4a38 100644 --- a/libs/binder/ndk/include_platform/android/binder_manager.h +++ b/libs/binder/ndk/include_platform/android/binder_manager.h @@ -18,11 +18,8 @@ #include <android/binder_ibinder.h> #include <android/binder_status.h> -#include <sys/cdefs.h> - -#ifndef __TRUSTY__ #include <android/llndk-versioning.h> -#endif +#include <sys/cdefs.h> __BEGIN_DECLS diff --git a/libs/binder/trusty/ndk/include/android/llndk-versioning.h b/libs/binder/trusty/ndk/include/android/llndk-versioning.h new file mode 100644 index 0000000000..3ae3d8f577 --- /dev/null +++ b/libs/binder/trusty/ndk/include/android/llndk-versioning.h @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2024 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. + */ +#pragma once + +#define __INTRODUCED_IN_LLNDK(x) /* nothing on Trusty */ diff --git a/libs/binder/trusty/ndk/include/sys/cdefs.h b/libs/binder/trusty/ndk/include/sys/cdefs.h index 7528f2bb45..4e9b0e83c6 100644 --- a/libs/binder/trusty/ndk/include/sys/cdefs.h +++ b/libs/binder/trusty/ndk/include/sys/cdefs.h @@ -27,4 +27,3 @@ #endif #define __INTRODUCED_IN(x) /* nothing on Trusty */ -#define __INTRODUCED_IN_LLNDK(x) /* nothing on Trusty */ diff --git a/libs/bufferstreams/Android.bp b/libs/bufferstreams/Android.bp index 365fc457d1..6c2a980f71 100644 --- a/libs/bufferstreams/Android.bp +++ b/libs/bufferstreams/Android.bp @@ -19,6 +19,7 @@ package { aconfig_declarations { name: "bufferstreams_flags", package: "com.android.graphics.bufferstreams.flags", + container: "system", srcs: [ "aconfig/bufferstreams_flags.aconfig", ], diff --git a/libs/bufferstreams/aconfig/bufferstreams_flags.aconfig b/libs/bufferstreams/aconfig/bufferstreams_flags.aconfig index e258725e3d..d0f7812d21 100644 --- a/libs/bufferstreams/aconfig/bufferstreams_flags.aconfig +++ b/libs/bufferstreams/aconfig/bufferstreams_flags.aconfig @@ -1,4 +1,5 @@ package: "com.android.graphics.bufferstreams.flags" +container: "system" flag { name: "bufferstreams_steel_thread" diff --git a/libs/gui/Android.bp b/libs/gui/Android.bp index 86431484d6..059e19ebb8 100644 --- a/libs/gui/Android.bp +++ b/libs/gui/Android.bp @@ -23,6 +23,7 @@ package { aconfig_declarations { name: "libgui_flags", package: "com.android.graphics.libgui.flags", + container: "system", srcs: ["libgui_flags.aconfig"], } diff --git a/libs/gui/libgui_flags.aconfig b/libs/gui/libgui_flags.aconfig index b081030c9f..38646992da 100644 --- a/libs/gui/libgui_flags.aconfig +++ b/libs/gui/libgui_flags.aconfig @@ -1,4 +1,5 @@ package: "com.android.graphics.libgui.flags" +container: "system" flag { name: "bq_setframerate" diff --git a/libs/input/Android.bp b/libs/input/Android.bp index 252040d1b0..20b35383bc 100644 --- a/libs/input/Android.bp +++ b/libs/input/Android.bp @@ -39,6 +39,7 @@ filegroup { aconfig_declarations { name: "com.android.input.flags-aconfig", package: "com.android.input.flags", + container: "system", srcs: ["input_flags.aconfig"], } diff --git a/libs/input/input_flags.aconfig b/libs/input/input_flags.aconfig index 54eeb39935..dbc002ccb3 100644 --- a/libs/input/input_flags.aconfig +++ b/libs/input/input_flags.aconfig @@ -1,4 +1,5 @@ package: "com.android.input.flags" +container: "system" flag { name: "enable_outbound_event_verification" diff --git a/services/gpuservice/GpuService.cpp b/services/gpuservice/GpuService.cpp index 48d793a4d4..080e62b164 100644 --- a/services/gpuservice/GpuService.cpp +++ b/services/gpuservice/GpuService.cpp @@ -70,6 +70,9 @@ GpuService::GpuService() }; GpuService::~GpuService() { + mGpuMem->stop(); + mGpuWork->stop(); + mGpuWorkAsyncInitThread->join(); mGpuMemAsyncInitThread->join(); } diff --git a/services/gpuservice/gpumem/GpuMem.cpp b/services/gpuservice/gpumem/GpuMem.cpp index 141fe021ee..d0783df109 100644 --- a/services/gpuservice/gpumem/GpuMem.cpp +++ b/services/gpuservice/gpumem/GpuMem.cpp @@ -61,6 +61,7 @@ void GpuMem::initialize() { return; } // Retry until GPU driver loaded or timeout. + if (mStop.load()) return; sleep(1); } diff --git a/services/gpuservice/gpumem/include/gpumem/GpuMem.h b/services/gpuservice/gpumem/include/gpumem/GpuMem.h index 9aa74d6863..16b201f516 100644 --- a/services/gpuservice/gpumem/include/gpumem/GpuMem.h +++ b/services/gpuservice/gpumem/include/gpumem/GpuMem.h @@ -34,6 +34,7 @@ public: // dumpsys interface void dump(const Vector<String16>& args, std::string* result); bool isInitialized() { return mInitialized.load(); } + void stop() { mStop.store(true); } // Traverse the gpu memory total map to feed the callback function. void traverseGpuMemTotals(const std::function<void(int64_t ts, uint32_t gpuId, uint32_t pid, @@ -48,6 +49,10 @@ private: // indicate whether ebpf has been initialized std::atomic<bool> mInitialized = false; + + // whether initialization should be stopped + std::atomic<bool> mStop = false; + // bpf map for GPU memory total data android::bpf::BpfMapRO<uint64_t, uint64_t> mGpuMemTotalMap; diff --git a/services/gpuservice/gpuwork/GpuWork.cpp b/services/gpuservice/gpuwork/GpuWork.cpp index fd703239e9..1a744abc6d 100644 --- a/services/gpuservice/gpuwork/GpuWork.cpp +++ b/services/gpuservice/gpuwork/GpuWork.cpp @@ -243,6 +243,7 @@ bool GpuWork::attachTracepoint(const char* programPath, const char* tracepointGr return false; } // Retry until GPU driver loaded or timeout. + if (mStop.load()) return false; sleep(1); errno = 0; } diff --git a/services/gpuservice/gpuwork/include/gpuwork/GpuWork.h b/services/gpuservice/gpuwork/include/gpuwork/GpuWork.h index cece9999c6..e70da540b9 100644 --- a/services/gpuservice/gpuwork/include/gpuwork/GpuWork.h +++ b/services/gpuservice/gpuwork/include/gpuwork/GpuWork.h @@ -40,6 +40,7 @@ public: ~GpuWork(); void initialize(); + void stop() { mStop.store(true); } // Dumps the GPU work information. void dump(const Vector<String16>& args, std::string* result); @@ -47,7 +48,7 @@ public: private: // Attaches tracepoint |tracepoint_group|/|tracepoint_name| to BPF program at path // |program_path|. The tracepoint is also enabled. - static bool attachTracepoint(const char* program_path, const char* tracepoint_group, + bool attachTracepoint(const char* program_path, const char* tracepoint_group, const char* tracepoint_name); // Native atom puller callback registered in statsd. @@ -80,6 +81,9 @@ private: // Indicates whether our eBPF components have been initialized. std::atomic<bool> mInitialized = false; + // Indicates whether eBPF initialization should be stopped. + std::atomic<bool> mStop = false; + // A thread that periodically checks whether |mGpuWorkMap| is nearly full // and, if so, clears it. std::thread mMapClearerThread; diff --git a/services/surfaceflinger/Android.bp b/services/surfaceflinger/Android.bp index 0989863b7d..dcef9a3775 100644 --- a/services/surfaceflinger/Android.bp +++ b/services/surfaceflinger/Android.bp @@ -10,6 +10,7 @@ package { aconfig_declarations { name: "surfaceflinger_flags", package: "com.android.graphics.surfaceflinger.flags", + container: "system", srcs: ["surfaceflinger_flags.aconfig"], } diff --git a/services/surfaceflinger/surfaceflinger_flags.aconfig b/services/surfaceflinger/surfaceflinger_flags.aconfig index 1a28b81483..abe7ec708f 100644 --- a/services/surfaceflinger/surfaceflinger_flags.aconfig +++ b/services/surfaceflinger/surfaceflinger_flags.aconfig @@ -1,4 +1,5 @@ package: "com.android.graphics.surfaceflinger.flags" +container: "system" flag { name: "misc1" |