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

Commit 4881da8b authored by Nate Myren's avatar Nate Myren Committed by Android Build Coastguard Worker
Browse files

RESTRICT AUTOMERGE Use static token for myAttributionSource in ServiceUtilities

Bug: 258672042
Test: manual
Change-Id: I44243bbbd68db9ee8b5c4ba02a061e14bd300d20
(cherry picked from commit ca6e2770)
Merged-In: I44243bbbd68db9ee8b5c4ba02a061e14bd300d20
parent 1e2ff894
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -103,11 +103,10 @@ std::optional<AttributionSourceState> resolveAttributionSource(
    AttributionSourceState myAttributionSource;
    myAttributionSource.uid = VALUE_OR_FATAL(android::legacy2aidl_uid_t_int32_t(getuid()));
    myAttributionSource.pid = VALUE_OR_FATAL(android::legacy2aidl_pid_t_int32_t(getpid()));
    if (callerAttributionSource.token != nullptr) {
        myAttributionSource.token = callerAttributionSource.token;
    } else {
        myAttributionSource.token = sp<BBinder>::make();
    }
    // Create a static token for audioserver requests, which identifies the
    // audioserver to the app ops system
    static sp<BBinder> appOpsToken = sp<BBinder>::make();
    myAttributionSource.token = appOpsToken;
    myAttributionSource.next.push_back(nextAttributionSource);

    return std::optional<AttributionSourceState>{myAttributionSource};