Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dbe9ac45 authored by Atneya Nair's avatar Atneya Nair Committed by Cherrypicker Worker
Browse files

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.

Fixes: 330359963
Test: dumpsys batterystats contains audio info
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5af964cd57a27a8aa49e1969daed9ee21d58d1f9)
Merged-In: I271eb5e8cf709e0e7b74ed767c5e232ba0e548b7
Change-Id: I271eb5e8cf709e0e7b74ed767c5e232ba0e548b7
parent cb142de5
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -66,14 +66,14 @@ public:
        Parcel data, reply;
        data.writeInterfaceToken(IBatteryStats::getInterfaceDescriptor());
        data.writeInt32(uid);
        remote()->transact(NOTE_START_AUDIO_TRANSACTION, data, &reply);
        remote()->transact(NOTE_START_AUDIO_TRANSACTION, data, &reply, IBinder::FLAG_ONEWAY);
    }

    virtual void noteStopAudio(int uid) {
        Parcel data, reply;
        data.writeInterfaceToken(IBatteryStats::getInterfaceDescriptor());
        data.writeInt32(uid);
        remote()->transact(NOTE_STOP_AUDIO_TRANSACTION, data, &reply);
        remote()->transact(NOTE_STOP_AUDIO_TRANSACTION, data, &reply, IBinder::FLAG_ONEWAY);
    }

    virtual void noteResetVideo() {
@@ -85,7 +85,7 @@ public:
    virtual void noteResetAudio() {
        Parcel data, reply;
        data.writeInterfaceToken(IBatteryStats::getInterfaceDescriptor());
        remote()->transact(NOTE_RESET_AUDIO_TRANSACTION, data, &reply);
        remote()->transact(NOTE_RESET_AUDIO_TRANSACTION, data, &reply, IBinder::FLAG_ONEWAY);
    }

    virtual void noteFlashlightOn(int uid) {