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

Commit 5186695a authored by Ray Essick's avatar Ray Essick
Browse files

mediea metrics audiopolicy pkg fields

if the requesting/active package field is empty, substitute in
the uid of the corresponding app -- so we get some identification.

Bug: 80441117
Test: dumpsys media.metrics
Change-Id: I5dfe014b82c30bd25cb9a4b129a351949c12945f
parent c1c6ce63
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -528,10 +528,13 @@ status_t AudioPolicyService::startInput(audio_port_handle_t portId, bool *silenc

            item->setCString(kAudioPolicyRqstSrc,
                             audioSourceString(client->attributes.source).c_str());
            item->setInt32(kAudioPolicyRqstSession, client->session);
            if (client->opPackageName.size() != 0) {
                item->setCString(kAudioPolicyRqstPkg,
                                 std::string(String8(client->opPackageName).string()).c_str());
            item->setInt32(kAudioPolicyRqstSession, client->session);

            } else {
                item->setCString(kAudioPolicyRqstPkg, to_string(client->uid).c_str());
            }
            item->setCString(
                    kAudioPolicyRqstDevice, getDeviceTypeStrForPortId(client->deviceId).c_str());

@@ -550,9 +553,13 @@ status_t AudioPolicyService::startInput(audio_port_handle_t portId, bool *silenc
                        // keeps the last of the clients marked active
                        item->setCString(kAudioPolicyActiveSrc,
                                         audioSourceString(other->attributes.source).c_str());
                        item->setInt32(kAudioPolicyActiveSession, other->session);
                        if (other->opPackageName.size() != 0) {
                            item->setCString(kAudioPolicyActivePkg,
                                 std::string(String8(other->opPackageName).string()).c_str());
                        item->setInt32(kAudioPolicyActiveSession, other->session);
                        } else {
                            item->setCString(kAudioPolicyRqstPkg, to_string(other->uid).c_str());
                        }
                        item->setCString(kAudioPolicyActiveDevice,
                                         getDeviceTypeStrForPortId(other->deviceId).c_str());
                    }