Commit Graph

66092 Commits

Author SHA1 Message Date
Bart Van Assche
32a9bfec7b libhealthloop: Modify receive buffer overflow handling
Let epoll_wait() wake up healthd if a receive buffer overflow has
happened. If a receive buffer overflow happened, this indicates that one
or more power supply uevent messages have been discarded. Handle this by
updating the battery statistics. This is the approach recommended in the
netlink(7) man page. From that manual page: "However, reliable
transmissions from kernel to user are impossible in any case. The kernel
can't send a netlink message if the socket buffer is full: the message
will be dropped and the kernel and the user-space process will no longer
have the same view of kernel state.  It is up to the application to
detect when this happens (via the ENOBUFS error returned by recvmsg(2))
and resynchronize."

Bug: 362986353
Change-Id: I0c89907eaa014f9e2859a73b29239e82f066f03f
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2024-09-04 09:30:38 -07:00
Bart Van Assche
7b7948b1d5 libhealthloop: Use designated initializers
Make the code somewhat easier to read by using designated initializers.
No functionality has been changed.

Bug: 362986353
Change-Id: I707ea158c9c45eeb2662d7b5c1efc9b63f0375cb
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2024-09-03 17:01:44 -07:00
Bart Van Assche
5264619177 libhealthloop: Reduce the number of ScheduleBatteryUpdate() calls
Instead of calling ScheduleBatteryUpdate() every time a uevent has been
received, only call it after the netlink socket receive buffer has been
drained. This change is safe because the contents of the power supply
uevent messages is ignored.

A subtle change in this CL is that an additional call to
uevent_kernel_multicast_recv() is introduced after all the receive
buffer has been drained. In case of a receive buffer overflow, this
extra call will receive and clear the socket error (sk_err).

Bug: 362986353
Change-Id: Ic1c489dde3338f0142def743b4cd654363517486
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2024-09-03 17:01:44 -07:00
Bart Van Assche
1f2a9d0b08 libhealthloop: Terminate KLOG messages with a newline
KLOG messages are sent to /dev/kmsg and hence must be terminated with a
newline character.

Bug: 362986353
Change-Id: I7484b7722f05d8defb9529788324ac51228b7ea6
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2024-09-03 17:01:44 -07:00
Bart Van Assche
b8e15ebaa8 libhealthloop: Make the filterPowerSupplyEvents unit test easier to maintain
Instead of hard-coding input lengths, let the compiler calculate the
input length.

Change-Id: I47d849b85dd983706bfada0293ccbdd04c8a597a
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2024-09-03 17:01:44 -07:00
Treehugger Robot
bee59e3b47 Merge "Revert "Define vintf_fragments as modules"" into main 2024-08-30 15:58:23 +00:00
Greg Kaiser
3892274102 Revert "Define vintf_fragments as modules"
This reverts commit cf0a2dd5b0.

Reason for revert: b/363215494, breaks WiFi for at least some devices

Change-Id: I5137957087dde51c0049416404f410f53dd912f3
2024-08-30 14:07:37 +00:00
Kiyoung Kim
71af7d2bfe Merge "Define vintf_fragments as modules" into main 2024-08-30 08:26:49 +00:00
Pawan Wagh
f25f4eac0c Merge "Fuzzer seed corpus for android.hardware.health.IHealth.default" into main 2024-08-29 22:01:28 +00:00
Devin Moore
2f9e4310ce Merge "Re-add the wildcard instance name for ISharedSecret in FCM 202504" into main 2024-08-29 20:43:39 +00:00
Pawan Wagh
7665b84c32 Fuzzer seed corpus for android.hardware.health.IHealth.default
Bug: 295220956
Test: TH
Flag: TEST_ONLY
Change-Id: Ia601f9c9aeb0e76824853241b6b52ee0cdff1fb5
2024-08-29 19:48:04 +00:00
Pranav Garg (xWF)
5e3235fbf7 Fixing isDeviceIdAttestationRequired to require both cases instead of just one am: e759072541
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3246840

Change-Id: Ia3f79483d3381eb4771515f758866fb3b76ee09b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 23:55:25 +00:00
Treehugger Robot
cf0b316966 Merge "Update comment about Weaver slot assertion" into main 2024-08-28 15:22:39 +00:00
Karuna Wadhera
69a761318f Merge "Pass in allow_any_mode when verifying DICE chains" into main 2024-08-28 14:03:19 +00:00
Eric Biggers
b267fcced5 Update comment about Weaver slot assertion
Explain more clearly why this assertion is important.

Test: comment-only change
Bug: 356562932
Change-Id: I0ef2862fb6fbb062520c98935d347f1445a7dfae
2024-08-28 00:11:28 +00:00
Pranav Garg (xWF)
e759072541 Fixing isDeviceIdAttestationRequired to require both cases instead of just one
Bug: 356536705

Change-Id: I15326e68fc2ea1ce9a2dfbe7498790900ebb43e4
(cherry picked from commit f74d274807)
2024-08-27 23:54:44 +00:00
Andrew Lassalle
65355ad863 Merge "Improve syntax on radio config AIDLs" into main 2024-08-27 22:55:32 +00:00
Treehugger Robot
dd98cc1189 Merge "Fixing isDeviceIdAttestationRequired to require both cases instead of just one" into main 2024-08-27 22:11:59 +00:00
Andrew Lassalle
a64dac8cb4 Improve syntax on radio config AIDLs
Make non functional changes to the AIDL files to improve the readability
of the files. Make syntax improvements and fix typos.

Bug: 355621930
Test: m
Change-Id: I9f12bab6d32b3ad204a3b88feb778b5cdd8484d7
2024-08-27 13:31:20 -07:00
Pranav Garg (xWF)
f74d274807 Fixing isDeviceIdAttestationRequired to require both cases instead of just one
Bug: 356536705

Change-Id: I15326e68fc2ea1ce9a2dfbe7498790900ebb43e4
2024-08-27 18:36:15 +00:00
Bart Van Assche
d9974eb049 Merge "Revert "libhealthloop: Handle netlink receive buffer overflows"" into main 2024-08-27 15:38:47 +00:00
Bart Van Assche
185589ba6c Revert "libhealthloop: Handle netlink receive buffer overflows"
Revert this CL because there are several signs that too much time
is spent in healthd and because CL "libhealthloop: Handle netlink
receive buffer overflows" is suspected of causing an infinite loop.

Bug: 359559224
Change-Id: Iaec132da47284d662b357b901b81b21fb6d7cd9e
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2024-08-27 14:22:14 +00:00
Pindar Yang
7732e91f50 Merge "Revert "Convert hardware/interfaces/compatibility_matrices/Andro..."" into main 2024-08-27 03:25:22 +00:00
Pindar Yang
08e6d32599 Revert "Convert hardware/interfaces/compatibility_matrices/Andro..."
Revert submission 3195743-compatibility_matrix

Reason for revert: Build Break, Bug: 361227456

Reverted changes: /q/submissionid:3195743-compatibility_matrix

Change-Id: I9a0e678942694a1ea0d068de381d04e2e4b135f8
2024-08-27 03:23:21 +00:00
Karuna Wadhera
eabdb6edf0 Update getDiceChainKind for VSR >15
Bug: 346861728
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I8698663c29c8d91e7b39ca02e588b87377356363
2024-08-26 12:25:04 +00:00
Karuna Wadhera
ca6d8cce51 Pass in allow_any_mode when verifying DICE chains
1. allow_any_mode is set as true when the VM RKP instance is being
   tested (since the bootloader is unlocked for VTS tests and therefore
   the VM DICE chain will necessarily have at least one non-normal
   mode.)
2. allow_any_mode is set as true for non-user type builds.

Bug: 318483637
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I15ec3ad32f08eecd8478df14f8efa71fdb0b5d08
2024-08-22 18:48:58 +00:00
Devin Moore
75808752a0 Re-add the wildcard instance name for ISharedSecret in FCM 202504
It was added in aosp/3038254 and removed in a merge conflict resolution in ag/27273371

Test: m
Bug: 346861728
Change-Id: Ie1d3897697e40fca1067442348d400bf6bdee880
2024-08-22 16:01:44 +00:00
Treehugger Robot
a7fffef352 Merge "Retroactively allow sounddose V3 in 202404 FCM" into main 2024-08-21 23:38:48 +00:00
Devin Moore
845b0855f1 Retroactively allow sounddose V3 in 202404 FCM
There are changes in common audio libraries that force the sounddose
implementation to be bumped if any of the other audio implementations
are bumped.
Since we want to deprecate the sounddose interface and remove it from
FCMs > 202404, we need to retroactively allow the new sounddose version.
The other audio interfaces don't need this treatment because the newer
versions are added to the newer FCMs and we allow older devices to
implement them.

Test: m
Bug: 361383071
Change-Id: I195053bb6c5b6cb01584398eafc86f8fbcdd1148
2024-08-21 22:33:28 +00:00
Treehugger Robot
722afde62a Merge "audio: Implement more accurate timing for the stub stream" into main 2024-08-21 20:16:07 +00:00
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
Vlad Popa
e2a71fb696 Remove the ISoundDoseFactory HAL library
When supporting the audio AIDL HAL, we do not use the ISoundDoseFactory
anymore. Removing it from the compatibility matrix.

Flag: EXEMPT bugfix
Test: trivial
Bug: 356641174
Change-Id: I241c4b93ea6aa4e5499bc9e924d6df4f4bd464a7
2024-08-21 10:09:52 -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
Kiyoung Kim
cf0a2dd5b0 Define vintf_fragments as modules
Define vintf_fragments as modules if the file is shared among multiple
modules to avoid any conflicts.

Bug: 322089980
Test: aosp_cf_x86_64_phone build succeeded
Change-Id: I1d00623e3e6da6bb787a152d81eb94822153388f
2024-08-12 15:31:10 +09: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