Skip to content

Commit 99871bf

Browse files
delphijGerrit Code Review
authored andcommitted
Merge "Merge 24Q4 into AOSP main" into main
2 parents c8cb369 + 2cb09d0 commit 99871bf

562 files changed

Lines changed: 21001 additions & 15436 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Android.bp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@ license {
3838

3939
cc_library_headers {
4040
name: "native_headers",
41+
vendor_available: true,
4142
host_supported: true,
43+
target: {
44+
windows: {
45+
enabled: true,
46+
},
47+
},
4248
export_include_dirs: [
4349
"include/",
4450
],

PREUPLOAD.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp
2424
libs/nativewindow/
2525
libs/renderengine/
2626
libs/ui/
27+
libs/vibrator/
2728
libs/vr/
2829
opengl/libs/
2930
services/bufferhub/

cmds/dumpstate/dumpstate.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,6 +1559,13 @@ static void DumpstateLimitedOnly() {
15591559
RunDumpsys("DUMPSYS CONNECTIVITY REQUESTS", {"connectivity", "requests"},
15601560
CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10));
15611561

1562+
printf("========================================================\n");
1563+
printf("== Networking Policy\n");
1564+
printf("========================================================\n");
1565+
1566+
RunDumpsys("DUMPSYS NETWORK POLICY", {"netpolicy"}, CommandOptions::WithTimeout(90).Build(),
1567+
SEC_TO_MSEC(10));
1568+
15621569
printf("========================================================\n");
15631570
printf("== Dropbox crashes\n");
15641571
printf("========================================================\n");

cmds/evemu-record/main.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ enum TimestampBase {
5050
/// The first event received from the device.
5151
FirstEvent,
5252

53-
/// The time when the system booted.
54-
Boot,
53+
/// The Unix epoch (00:00:00 UTC on 1st January 1970), so that all timestamps are Unix
54+
/// timestamps. This makes the events in the recording easier to match up with those from other
55+
/// log sources.
56+
Epoch,
5557
}
5658

5759
fn get_choice(max: u32) -> u32 {
@@ -188,7 +190,7 @@ fn print_events(
188190
//
189191
// [0]: https://gitlab.freedesktop.org/libevdev/evemu/-/commit/eba96a4d2be7260b5843e65c4b99c8b06a1f4c9d
190192
TimestampBase::FirstEvent => event.time - TimeVal::new(0, 1),
191-
TimestampBase::Boot => TimeVal::new(0, 0),
193+
TimestampBase::Epoch => TimeVal::new(0, 0),
192194
};
193195
print_event(output, &event.offset_time_by(start_time))?;
194196
loop {

cmds/flatland/GLHelper.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include <GLES2/gl2.h>
2020
#include <GLES2/gl2ext.h>
21+
#include <com_android_graphics_libgui_flags.h>
2122
#include <gui/SurfaceComposerClient.h>
2223
#include <ui/DisplayMode.h>
2324

@@ -202,6 +203,14 @@ bool GLHelper::getShaderProgram(const char* name, GLuint* outPgm) {
202203

203204
bool GLHelper::createNamedSurfaceTexture(GLuint name, uint32_t w, uint32_t h,
204205
sp<GLConsumer>* glConsumer, EGLSurface* surface) {
206+
#if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_CONSUMER_BASE_OWNS_BQ)
207+
sp<GLConsumer> glc = new GLConsumer(name, GL_TEXTURE_EXTERNAL_OES, false, true);
208+
glc->setDefaultBufferSize(w, h);
209+
glc->getSurface()->setMaxDequeuedBufferCount(2);
210+
glc->setConsumerUsageBits(GRALLOC_USAGE_HW_COMPOSER);
211+
212+
sp<ANativeWindow> anw = glc->getSurface();
213+
#else
205214
sp<IGraphicBufferProducer> producer;
206215
sp<IGraphicBufferConsumer> consumer;
207216
BufferQueue::createBufferQueue(&producer, &consumer);
@@ -212,6 +221,7 @@ bool GLHelper::createNamedSurfaceTexture(GLuint name, uint32_t w, uint32_t h,
212221
glc->setConsumerUsageBits(GRALLOC_USAGE_HW_COMPOSER);
213222

214223
sp<ANativeWindow> anw = new Surface(producer);
224+
#endif // COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_CONSUMER_BASE_OWNS_BQ)
215225
EGLSurface s = eglCreateWindowSurface(mDisplay, mConfig, anw.get(), nullptr);
216226
if (s == EGL_NO_SURFACE) {
217227
fprintf(stderr, "eglCreateWindowSurface error: %#x\n", eglGetError());

cmds/idlcli/Android.bp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ package {
2424
cc_defaults {
2525
name: "idlcli-defaults",
2626
shared_libs: [
27-
"android.hardware.vibrator-V2-ndk",
27+
"android.hardware.vibrator-V3-ndk",
2828
"android.hardware.vibrator@1.0",
2929
"android.hardware.vibrator@1.1",
3030
"android.hardware.vibrator@1.2",

cmds/idlcli/vibrator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ inline ndk::ScopedAStatus NullptrStatus() {
4949
template <typename I>
5050
inline auto getService(std::string name) {
5151
const auto instance = std::string() + I::descriptor + "/" + name;
52-
auto vibBinder = ndk::SpAIBinder(AServiceManager_getService(instance.c_str()));
52+
auto vibBinder = ndk::SpAIBinder(AServiceManager_checkService(instance.c_str()));
5353
return I::fromBinder(vibBinder);
5454
}
5555

data/etc/input/motion_predictor_config.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@
3535
3636
The jerk thresholds are based on normalized dt = 1 calculations.
3737
-->
38-
<low-jerk>1.0</low-jerk>
39-
<high-jerk>1.1</high-jerk>
38+
<low-jerk>1.5</low-jerk>
39+
<high-jerk>2.0</high-jerk>
40+
41+
<!-- The alpha in the first-order IIR filter for jerk smoothing. An alpha
42+
of 1 results in no smoothing.-->
43+
<jerk-alpha>0.25</jerk-alpha>
4044
</motion-predictor>
4145

include/android/performance_hint.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ typedef struct AWorkDuration AWorkDuration;
8484

8585
/**
8686
* An opaque type representing a handle to a performance hint manager.
87-
* It must be released after use.
8887
*
8988
* To use:<ul>
9089
* <li>Obtain the performance hint manager instance by calling

include/android/surface_control.h

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ typedef struct ASurfaceTransactionStats ASurfaceTransactionStats;
145145
* Buffers which are replaced or removed from the scene in the transaction invoking
146146
* this callback may be reused after this point.
147147
*
148+
* Starting with API level 36, prefer using \a ASurfaceTransaction_OnBufferRelease to listen
149+
* to when a buffer is ready to be reused.
150+
*
148151
* \param context Optional context provided by the client that is passed into
149152
* the callback.
150153
*
@@ -157,8 +160,7 @@ typedef struct ASurfaceTransactionStats ASurfaceTransactionStats;
157160
* Available since API level 29.
158161
*/
159162
typedef void (*ASurfaceTransaction_OnComplete)(void* _Null_unspecified context,
160-
ASurfaceTransactionStats* _Nonnull stats)
161-
__INTRODUCED_IN(29);
163+
ASurfaceTransactionStats* _Nonnull stats);
162164

163165
/**
164166
* The ASurfaceTransaction_OnCommit callback is invoked when transaction is applied and the updates
@@ -186,8 +188,36 @@ typedef void (*ASurfaceTransaction_OnComplete)(void* _Null_unspecified context,
186188
* Available since API level 31.
187189
*/
188190
typedef void (*ASurfaceTransaction_OnCommit)(void* _Null_unspecified context,
189-
ASurfaceTransactionStats* _Nonnull stats)
190-
__INTRODUCED_IN(31);
191+
ASurfaceTransactionStats* _Nonnull stats);
192+
193+
/**
194+
* The ASurfaceTransaction_OnBufferRelease callback is invoked when a buffer that was passed in
195+
* ASurfaceTransaction_setBuffer is ready to be reused.
196+
*
197+
* This callback is guaranteed to be invoked if ASurfaceTransaction_setBuffer is called with a non
198+
* null buffer. If the buffer in the transaction is replaced via another call to
199+
* ASurfaceTransaction_setBuffer, the callback will be invoked immediately. Otherwise the callback
200+
* will be invoked before the ASurfaceTransaction_OnComplete callback after the buffer was
201+
* presented.
202+
*
203+
* If this callback is set, caller should not release the buffer using the
204+
* ASurfaceTransaction_OnComplete.
205+
*
206+
* \param context Optional context provided by the client that is passed into the callback.
207+
*
208+
* \param release_fence_fd Returns the fence file descriptor used to signal the release of buffer
209+
* associated with this callback. If this fence is valid (>=0), the buffer has not yet been released
210+
* and the fence will signal when the buffer has been released. If the fence is -1 , the buffer is
211+
* already released. The recipient of the callback takes ownership of the fence fd and is
212+
* responsible for closing it.
213+
*
214+
* THREADING
215+
* The callback can be invoked on any thread.
216+
*
217+
* Available since API level 36.
218+
*/
219+
typedef void (*ASurfaceTransaction_OnBufferRelease)(void* _Null_unspecified context,
220+
int release_fence_fd);
191221

192222
/**
193223
* Returns the timestamp of when the frame was latched by the framework. Once a frame is
@@ -251,7 +281,7 @@ int64_t ASurfaceTransactionStats_getAcquireTime(
251281
/**
252282
* The returns the fence used to signal the release of the PREVIOUS buffer set on
253283
* this surface. If this fence is valid (>=0), the PREVIOUS buffer has not yet been released and the
254-
* fence will signal when the PREVIOUS buffer has been released. If the fence is -1 , the PREVIOUS
284+
* fence will signal when the PREVIOUS buffer has been released. If the fence is -1, the PREVIOUS
255285
* buffer is already released. The recipient of the callback takes ownership of the
256286
* previousReleaseFenceFd and is responsible for closing it.
257287
*
@@ -353,13 +383,39 @@ void ASurfaceTransaction_setZOrder(ASurfaceTransaction* _Nonnull transaction,
353383
* Note that the buffer must be allocated with AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE
354384
* as the surface control might be composited using the GPU.
355385
*
386+
* Starting with API level 36, prefer using \a ASurfaceTransaction_setBufferWithRelease to
387+
* set a buffer and a callback which will be invoked when the buffer is ready to be reused.
388+
*
356389
* Available since API level 29.
357390
*/
358391
void ASurfaceTransaction_setBuffer(ASurfaceTransaction* _Nonnull transaction,
359392
ASurfaceControl* _Nonnull surface_control,
360393
AHardwareBuffer* _Nonnull buffer, int acquire_fence_fd)
361394
__INTRODUCED_IN(29);
362395

396+
/**
397+
* Updates the AHardwareBuffer displayed for \a surface_control. If not -1, the
398+
* acquire_fence_fd should be a file descriptor that is signaled when all pending work
399+
* for the buffer is complete and the buffer can be safely read.
400+
*
401+
* The frameworks takes ownership of the \a acquire_fence_fd passed and is responsible
402+
* for closing it.
403+
*
404+
* Note that the buffer must be allocated with AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE
405+
* as the surface control might be composited using the GPU.
406+
*
407+
* When the buffer is ready to be reused, the ASurfaceTransaction_OnBufferRelease
408+
* callback will be invoked. If the buffer is null, the callback will not be invoked.
409+
*
410+
* Available since API level 36.
411+
*/
412+
void ASurfaceTransaction_setBufferWithRelease(ASurfaceTransaction* _Nonnull transaction,
413+
ASurfaceControl* _Nonnull surface_control,
414+
AHardwareBuffer* _Nonnull buffer,
415+
int acquire_fence_fd, void* _Null_unspecified context,
416+
ASurfaceTransaction_OnBufferRelease _Nonnull func)
417+
__INTRODUCED_IN(36);
418+
363419
/**
364420
* Updates the color for \a surface_control. This will make the background color for the
365421
* ASurfaceControl visible in transparent regions of the surface. Colors \a r, \a g,

0 commit comments

Comments
 (0)