diff options
| author | 2024-03-20 16:26:51 -0700 | |
|---|---|---|
| committer | 2024-03-20 16:32:06 -0700 | |
| commit | 364ce02f7d46ed99e93f3f156ae1907f74de449f (patch) | |
| tree | 0b2f901c6b555f65e0ee09117f9d7cdffea2e7cd | |
| parent | d699185728f605816646ec0599ee0838d53c710e (diff) | |
Migrate BatteryStats audio calls to oneway
The batterystats binder interfaces used by audioserver are currently
synchronous, which causes layering violations leading to threadpool
starvation in system server.
Migrate the calls used by audioserver in particular to oneway. These
calls are already void returning, and are logically async.
It is generally not recommended to mix oneway and non-oneway calls due
to unclear ordering, but migrate the three methods used by audioserver
together, and add a comment to explain. This interface is already
mixed oneway for this reason.
Fixes: 330359963
Test: dumpsys batterystats contains audio info
Change-Id: I7220ad5287b142821ef39d175c3bf88d4a898a43
| -rw-r--r-- | core/java/com/android/internal/app/IBatteryStats.aidl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/java/com/android/internal/app/IBatteryStats.aidl b/core/java/com/android/internal/app/IBatteryStats.aidl index 5f688f6406bc..99b3f9a16355 100644 --- a/core/java/com/android/internal/app/IBatteryStats.aidl +++ b/core/java/com/android/internal/app/IBatteryStats.aidl @@ -43,14 +43,16 @@ interface IBatteryStats { void noteStartVideo(int uid); @EnforcePermission("UPDATE_DEVICE_STATS") void noteStopVideo(int uid); + // The audio battery stats interface is oneway to prevent inversion. These calls + // are ordered with respect to each other, but not with any other calls. @EnforcePermission("UPDATE_DEVICE_STATS") - void noteStartAudio(int uid); + oneway void noteStartAudio(int uid); @EnforcePermission("UPDATE_DEVICE_STATS") - void noteStopAudio(int uid); + oneway void noteStopAudio(int uid); @EnforcePermission("UPDATE_DEVICE_STATS") void noteResetVideo(); @EnforcePermission("UPDATE_DEVICE_STATS") - void noteResetAudio(); + oneway void noteResetAudio(); @EnforcePermission("UPDATE_DEVICE_STATS") void noteFlashlightOn(int uid); @EnforcePermission("UPDATE_DEVICE_STATS") |