Commit Graph

66060 Commits

Author SHA1 Message Date
Mikhail Naganov
10fc96386e audio: Implement more accurate timing for the stub stream
Stub output stream is like a /dev/null audio device, however
for synchronous transfers it must block for the duration of
the audio chunk being transferred. Implement more accurate
accounting for the blocking time using the same approach as
employed by the remote submix stream implementation.

Bug: 356719263
Test: atest CtsNativeMediaAAudioTestCases
      on aosp_cf_x86_64_auto target
Change-Id: I137aed397246bcf2b5ef6789aa4d2d27ead64467
2024-08-21 11:34:05 -07:00
Treehugger Robot
c818adc8d4 Merge "codec2: BufferPoolClient: fix NPE in fetchBufferHandle if connection is null" into main 2024-08-20 20:16:45 +00:00
Treehugger Robot
08c7c29c11 Merge "audio: Start Binder pool thread explicitly" into main 2024-08-19 22:46:05 +00:00
Mikhail Naganov
1840d35645 audio: Start Binder pool thread explicitly
It was noted that calling 'ABinderProcess_startThreadPool'
results in the audio HAL service having more Binder pool
threads than without it. This is preferred to having
just one thread via 'ABinderProcess_joinThreadPool'
as in the latter case clients may seemingly be blocked
instead of being served by a newly spawned thread from
the pool.

Bug: 357669241
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ia8ed52b3c5a95cea12d063a0e75ac908af9260f8
2024-08-19 14:48:28 -07:00
Mikhail Naganov
a6c2d43c79 Merge "audio: Fix stream cleanup sequence" into main 2024-08-19 16:30:45 +00:00
Mikhail Naganov
0413d077f7 audio: Fix stream cleanup sequence
Move the cleanup of the stream worker thread from '~StreamCommonImpl'
up to concrete stream implementations. This is because when
the worker thread is stopping, it calls 'DriverInterface::shutdown'
method of the stream. At the time when '~StreamCommonImpl' is
running, the concrete stream class has already been destroyed.

The cleanup actually only happens in the case when the client
did not close the stream properly via 'IStreamCommon.close', or
when the stream creation has failed in the middle.

Bug: 355804294
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ie86f682af202976ed48d24338b2dffcfd20d9a76
2024-08-15 14:18:51 -07:00
mtk28629
6652cc6ad5 codec2: BufferPoolClient: fix NPE in fetchBufferHandle if connection is null
Do a null pointer check before connection->fetch().

Bug: 344846184
Flag: EXEMPT bugfix
Test:
1.atest android.media.decoder.cts.AdaptivePlaybackTest
2.atest android.media.decoder.cts.DecoderTest

Change-Id: I30031b4abf46f920b708320ffa3fa9d1598027b4
2024-08-15 13:47:17 -07:00
Ted Bauer
922c032573 Add new aconfig dependencies
Aconfig flagging is undergoing an internal storage migration. Add the
new dependencies required for it.

Bug: 347701310
Test: m
Flag: build.RELEASE_READ_FROM_NEW_STORAGE
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a99ec3073fb95840d965d3acbaee5c9aeabeba49)
Merged-In: I412df2b36f49215a8b2ffe156641720c14218ba0
Change-Id: I412df2b36f49215a8b2ffe156641720c14218ba0
2024-08-15 13:39:17 +00:00
Treehugger Robot
6c7d5ded29 Merge "Convert hardware/interfaces/compatibility_matrices/Android.mk to soong" into main 2024-08-15 09:07:38 +00:00
yangbill
a1d5770c37 Convert hardware/interfaces/compatibility_matrices/Android.mk to soong
Add a new attribute type which value could only be device_fcm and
product_fcm if set to the vintf_compatibility_matrix module type which
could be used to generate framework_compatibility_matrix.device.xml and
product_compatibility_matrix.xml in soong to convert the original Android.mk

Bug: 352234038
Bug: 344445679

Test: lunch aosp_cheetah-trunk_staging-userdebug
      m framework_compatibility_matrix.device.xml \
        product_compatibility_matrix.xml

Test: lunch aosp_trout_x86_64-trunk_staging-userdebug
      m framework_compatibility_matrix.device.xml \
        product_compatibility_matrix.xml

Test: lunch aosp_cf_x86_64_phone-trunk_staging-userdebug
      m framework_compatibility_matrix.device.xml \
        product_compatibility_matrix.xml
      diff $ANDROID_PRODUCT_OUT/system/etc/vintf/compatibility_matrix.device.xml \
           device/google/cuttlefish/system_image/compatibility_matrix.device.xml

Change-Id: I1690cf29462c91f5ab80f7a78f6df9cdb6abbf2f
2024-08-15 03:30:53 +00:00
Treehugger Robot
6883d48156 Merge "audio: Remove unnecessary std::move" into main 2024-08-13 20:48:53 +00:00
Treehugger Robot
c9777e83a1 Merge "automotive: Remove unnecessary std::move" into main 2024-08-13 20:07:37 +00:00
Yi Kong
99df7ced5d security: Remove unnecessary std::move
Moving a temporary object prevents copy elision, and could reduce
performance.

This fixes -Wpessimizing-move compiler warning.

Test: presubmit
Bug: 154270751
Change-Id: I378f1b9029f1a0711728ff14e4071263ad330504
2024-08-14 01:56:18 +08:00
Yi Kong
e62f97fb5b audio: Remove unnecessary std::move
Moving a temporary object prevents copy elision, and could reduce
performance.

This fixes -Wpessimizing-move compiler warning.

Test: presubmit
Bug: 154270751
Change-Id: Idb1a4abf4da9eb6dbe1e9a8fd66461d60985c8e1
2024-08-14 01:52:25 +08:00
Yi Kong
301f5e0d61 automotive: Remove unnecessary std::move
Moving a temporary object prevents copy elision, and could reduce
performance.

This fixes -Wpessimizing-move compiler warning.

Test: presubmit
Bug: 154270751
Change-Id: Ia2ffdb8addde27a67d2e2382bef1d45d5261f3ca
2024-08-14 01:50:44 +08:00
Wei Li
fc8d55a0bf Merge "Remove unused LOCAL_ variables and related logic in hardware/interfaces/compatibility_matrices/compatibility_matrix.mk." into main 2024-08-09 20:30:59 +00:00
Leon Scroggins
9e65f0a00d Merge "Assert the errors size to 1 for case SetDisplayBrightness" into main 2024-08-09 20:26:37 +00:00
Wei Li
fd11739a60 Remove unused LOCAL_ variables and related logic in hardware/interfaces/compatibility_matrices/compatibility_matrix.mk.
After most compatibility_matrices Make modules have been moved to Android.bp there are some unused variables and logic, so remove them to reduce the complexity which helps conversion to Android.bp and reviewing.

Bug: 352234038
Test: CIs
Change-Id: Ic2f4538b3e50cc1ca573634cd46eb64c4013420a
2024-08-08 20:38:59 -07:00
Roshan Pius
0f39c73d6e nfc: Change EXPECT_TRUE to ASSERT_TRUE
Fix other tests missed in aosp/3213615

Bug: 357008220
Change-Id: I0325f2c4efa327f2de389a5363244393ee7d0bea
Test: TH
2024-08-08 18:53:28 +00:00
grekit1024
779985a21d nfc: Change EXPECT_TRUE to ASSERT_TRUE
because if the timeout occurs, a null pointer exception will be caused, and ASSERT_TRUE can interrupt the continued execution of the case.

Test: done
Bug:357008220

Change-Id: I17332c065e35c69630fc24ca2d929c6bff767c08
Signed-off-by: grekit1024 <grekit1024@gmail.com>
2024-08-08 17:05:54 +08:00
Yuyang Huang
f1527f5a88 Add support for HFP_HARDWARE_OFFLOAD_DATAPATH session type
Bug: 345303008
Change-Id: I0de7fcfaa64ae94e3a78d03685e661c51416ae64
Test: m packages/modules/Bluetooth
Flag: com::android::bluetooth::flags::is_sco_managed_by_audio and HFP session type only enabled when flag is enabled
2024-08-07 21:29:18 +00:00
Yuyang Huang
9daf187ec6 improve condition check for LE audio session
Bug: 345303008
Change-Id: Ic360f5463dc9515047dc3cdf3e69564809ea06d3
Test: m packages/modules/Bluetooth
Flag: exempt, no logical change
2024-08-07 21:16:53 +00:00
Treehugger Robot
4720db9fd2 [automerger skipped] Merge "update vts setSimSlotMapping test cases to handle different MEP types Bug: 342543877 Test: atest PerInstance/RadioConfigTest#setSimSlotsMapping/0_android_hardware_radio_config_IRadioConfig_default" into android14-tests-dev am: 3d9d5d8530 -s ours
am skip reason: Merged-In I34229669713afabbb7802dfa7c79ff9689a7bdf5 with SHA-1 7529611056 is already in history

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3206357

Change-Id: I69dbace846761421219e81751bbdfe82e84a6ace
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-07 08:30:38 +00:00
sandeepjs
6bfe9867e9 [automerger skipped] update vts setSimSlotMapping test cases to handle different MEP am: 5ac83a65d0 -s ours
am skip reason: Merged-In I34229669713afabbb7802dfa7c79ff9689a7bdf5 with SHA-1 7529611056 is already in history

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3206357

Change-Id: I3792e62e8d93b2895d7fbfeeadcfe4041d7e88ea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-07 08:30:34 +00:00
Treehugger Robot
3d9d5d8530 Merge "update vts setSimSlotMapping test cases to handle different MEP types Bug: 342543877 Test: atest PerInstance/RadioConfigTest#setSimSlotsMapping/0_android_hardware_radio_config_IRadioConfig_default" into android14-tests-dev 2024-08-07 08:21:21 +00:00
Chan Wang
d6e11e29bb Merge "Mark 'android.hardware.common.fmq' as available in any apex" into main 2024-08-07 04:55:42 +00:00
Treehugger Robot
9471625f69 Merge "Update the UdsCertChain comment to reflect the latest recommendation." into main 2024-08-07 00:07:52 +00:00
Bart Van Assche
2ab04e760b Merge "libhealthloop: Only wake up for power supply events" into main 2024-08-06 23:51:23 +00:00
Tommy Chiu
2027a9b597 Update the UdsCertChain comment to reflect the latest recommendation.
Bug: 331136391
Test: comment update only
Change-Id: I72f45c85d106d87fcd4c56d4c4fa86eb1af8f5a7
2024-08-07 07:10:57 +08:00
Treehugger Robot
55d9f9c5a2 Merge "update vts setSimCardPower test cases to handle different MEP types Bug: 351698476 Test: atest VtsHalRadioTargetTest" into android14-tests-dev am: 1a07256b4b
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3207432

Change-Id: Iaa7d75cf2b4dab454b8dfc363fa6e9042057d59e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 21:39:01 +00:00
Ping Fan
401bc9f9c0 Fix validation logic in TvInputAidlTest am: 73b1d1aa5c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3207431

Change-Id: Id25285d354b3a5bd30141ef48b89231397337a95
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 21:38:38 +00:00
Treehugger Robot
1a07256b4b Merge "update vts setSimCardPower test cases to handle different MEP types Bug: 351698476 Test: atest VtsHalRadioTargetTest" into android14-tests-dev 2024-08-06 21:31:20 +00:00
Shunkai Yao
5ef1f45f9e Merge "Audio Effect : Add base implementation of commandImpl method" into main 2024-08-06 18:07:40 +00:00
Shunkai Yao
c3eee4f253 Merge "Adding yaoshunkai@ to hardware/interface/audio owner" into main 2024-08-06 18:00:34 +00:00
Shunkai Yao
b43047f795 Adding yaoshunkai@ to hardware/interface/audio owner
Bug: 305866207
Test: N/A
Change-Id: I6fa8bd91b344dceab0c864735bb7d50a36264b0c
2024-08-06 17:26:07 +00:00
sandeepjs
5ac83a65d0 update vts setSimSlotMapping test cases to handle different MEP
types
Bug: 342543877
Test: atest PerInstance/RadioConfigTest#setSimSlotsMapping/0_android_hardware_radio_config_IRadioConfig_default

Change-Id: I34229669713afabbb7802dfa7c79ff9689a7bdf5
Merged-In: I34229669713afabbb7802dfa7c79ff9689a7bdf5
(cherry picked from commit 7529611056)
2024-08-06 07:17:48 +00:00
sandeepjs
baa9f95b63 update vts setSimCardPower test cases to handle different MEP
types
Bug: 351698476
Test: atest VtsHalRadioTargetTest

Change-Id: I233a12514afb39de32ba72e350d0a5dc94c98daf
Merged-In: I233a12514afb39de32ba72e350d0a5dc94c98daf
2024-08-06 07:17:21 +00:00
Ping Fan
73b1d1aa5c Fix validation logic in TvInputAidlTest
[Description]
Handle validation incorrectly allows empty integer arrays, causing
potential errors.

Bug:348575546

[Test Report]
Test ok

Change-Id: Ie597fecfaa783b050510b11665a03e31ccb8feaf
(cherry picked from commit 3b85a4e59a)
2024-08-06 02:11:30 +00:00
Bart Van Assche
5c604b9a73 libhealthloop: Only wake up for power supply events
healthd receives power supply information as uevents and holds a
wakelock while receiving these uevents. Without uevent filter, suspend
is postponed indefinitely if a uevent is generated during suspend. Fix
this by attaching a BPF program to the uevent socket that filters out
all events that are not power supply events.

This CL replaces the following CLs:
* Lianwei Wang, healthd: Don't set all eventpoll wakeup-able,
  2015-07-09
  (https://android-review.googlesource.com/c/platform/system/core/+/158851).
* Stephane Lee, Add BPF filter to filter uevents for
  SUBSYSTEM=powersupply, 2022-05-06.

Multiple ideas and some code in this CL have been borrowed from
Stephane Lee's CL.

Bug: 139203596
Bug: 140330870
Bug: 203131934
Bug: 203229817
Bug: 203462310
Bug: 221725014
Test: Verified that a Pixel 2024 still wakes up if a USB cable is connected or disconnected.
Test: Verified that suspend and resume still works for a Pixel 2024 device.
Test: Verified that the following text appears in the Cuttlefish logcat output: "HealthLoop: Successfully attached BPF program to uevent socket"
Test: Verified as follows that recovery mode works fine with Cuttlefish: adb reboot recovery && adb root && adb shell dmesg | grep -E 'F DEBUG|HealthLoop'
Change-Id: I64446b103d660d220880461bdef7ef0f531e1734
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2024-08-05 15:56:25 -07:00
Bart Van Assche
0cfcfac12d libhealthloop: Handle netlink receive buffer overflows
The Linux kernel netlink implementation sets EPOLLERR if delivery of a
netlink message fails because of a buffer overrun (see also the Linux
kernel netlink_overrun() and sock_def_error_report() functions). Handle
buffer overruns by calling ScheduleBatteryUpdate() unconditionally.

Bug: 203462310
Change-Id: I54f7d239e6b4caad0db4d1b15de7c0385f796ebd
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2024-08-05 15:56:16 -07:00
Bart Van Assche
6fe3618e7c libhealthloop: Micro-optimize HealthLoop::RegisterEvent()
BoundFunction is an alias for std::function<>. Copying a function object
may be expensive. Use std::move() to avoid copying std::function<>. From
https://engdoc.corp.google.com/eng/doc/devguide/cpp/std_function.md:
"Generally prefer both accepting and passing by value if ownership is
transferred. Recall that when using value semantics, it's important to
also use std::move() when appropriate."

Bug: 203462310
Change-Id: I9fb87737dd5ce0fbb84bfbbdb0f8bb952dea1fbc
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2024-08-05 15:55:24 -07:00
Bart Van Assche
8bb6819c66 Merge "HealthLoop.cpp: Minimize #include directives" into main 2024-08-05 16:19:42 +00:00
Kangping Dong
0bac41a055 Merge "[Thread] add an override_apex for Thread HAL with simulation RCP" into main 2024-08-05 09:28:05 +00:00
Kangping Dong
2bc926ed05 [Thread] add an override_apex for Thread HAL with simulation RCP
This commit adds a new apex override for the Thread HAL which uses a
simulation RCP. This will be used by goldfish emulators.

Note that this can't be defined in /device/generic/goldfish because of
below error:

```
[100% 1/1] analyzing Android.bp files and generating ninja file at out/soong/build.sdk_phone64_x86_64.ninja
FAILED: out/soong/build.sdk_phone64_x86_64.ninja
cd "$(dirname "out/host/linux-x86/bin/soong_build")" && BUILDER="$PWD/$(basename "out/host/linux-x86/bin/soong_build")" && cd / && env -i  "$BUILDER"     --top "$TOP"     --soong_out "out/soong"     --out "out"     --soong_variables out/soong/soong.sdk_phone64_x86_64.variables -o o
ut/soong/build.sdk_phone64_x86_64.ninja --globListDir sdk_phone64_x86_64 --globFile out/soong/globs-sdk_phone64_x86_64.ninja -l out/.module_paths/Android.bp.list --available_env out/soong/soong.environment.available --used_env out/soong/soong.environment.used.sdk_phone64_x86_64.bui
ld Android.bp
Warning: Module 'androidx.wear_wear' depends on non-existing optional_uses_libs 'wear-sdk'
Warning: Module 'androidx.wear.compose_compose-foundation' depends on non-existing optional_uses_libs 'wear-sdk'
error: hardware/interfaces/threadnetwork/aidl/default/Android.bp:103:1: "com.android.hardware.threadnetwork" depends on undefined module "goldfish-threadnetwork-service.rc".
Module "com.android.hardware.threadnetwork" is defined in namespace "." which can read these 1 namespaces: ["."]
Module "goldfish-threadnetwork-service.rc" can be found in these namespaces: ["device/generic/goldfish"]
```

Bug: 356079409
Test: verified that "adb shell cmd thread_network join" works
Change-Id: I5356df53486fe9555ab34a0c8402e7be1b31309f
2024-08-05 16:38:02 +08:00
Bart Van Assche
7087858515 HealthLoop.cpp: Minimize #include directives
Remove the #include directives for header files of which no symbols are
used.

Bug: 203462310
Change-Id: I0d1678d9d01f05d7dc83e70b5f4df0f1129b1968
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2024-08-04 16:20:25 -07:00
Bart Van Assche
ce06c8ba6f health/2.1/default/Android.bp: Reformat with bpfmt -s -w
Change-Id: I04a94776bda9bbd08b2af2dceba177e90f60e27c
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2024-08-04 07:20:58 -07:00
Sandeep Jawalkar
a345db34d8 Merge "update vts setSimSlotMapping test cases to handle different MEP types Bug: 342543877 Test: atest PerInstance/RadioConfigTest#setSimSlotsMapping/0_android_hardware_radio_config_IRadioConfig_default" into main 2024-08-03 23:46:13 +00:00
Chan Wang
eb2c1450a1 Mark 'android.hardware.common.fmq' as available in any apex
The generated ndk library is used by our project and we have the requirement of marking all our libraries as available in any apex.

Bug: b / 352027888

Test: m
Change-Id: I04a73ee8acdb3626dfcdc93543c0b128816cb8b5
2024-08-02 13:55:50 +00:00
Jakub Tyszkowski
291b5d7510 VTS: Support VERSION_AIDL_V5
Bug: 352454998
Test: atest VtsHalBluetoothAudioTargetTest
Flag: Exempt; test only change
Change-Id: Icfca5680359a8287bd5994de26573a89c70f34da
2024-08-02 13:05:27 +00:00
Jakub Tyszkowski
f5015ce683 Fix matching the results
Trivial fix of using wrong variable name.

Bug: 352454998
Test: atest VtsHalBluetoothAudioTargetTest
Flag: Exempt; trivial fix covered with unit tests
Change-Id: I666c684dbd9f2b58a3d1cbe7449e21af57e55df4
2024-08-02 12:47:58 +00:00