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

Commit 03a95163 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

AudioService: fix permission for addOnDevicesForAttributesChanged

Bug: 352303112
Flag: EXEMPT security
Test: atest CtsMediaAudioTestCases:DevicesForAttributesTest
Change-Id: I10eba687a2e33fe5d9bb39c32c20761ab82d8f50
parent 8731e602
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -471,6 +471,7 @@ interface IAudioService {

    List<AudioDeviceAttributes> getDevicesForAttributesUnprotected(in AudioAttributes attributes);

    @EnforcePermission(anyOf = {"MODIFY_AUDIO_ROUTING", "QUERY_AUDIO_STATE"})
    void addOnDevicesForAttributesChangedListener(in AudioAttributes attributes,
            in IDevicesForAttributesCallback callback);

+2 −0
Original line number Diff line number Diff line
@@ -3567,8 +3567,10 @@ public class AudioService extends IAudioService.Stub
     * @see AudioManager#addOnDevicesForAttributesChangedListener(
     *      AudioAttributes, Executor, OnDevicesForAttributesChangedListener)
     */
    @android.annotation.EnforcePermission(anyOf = { MODIFY_AUDIO_ROUTING, QUERY_AUDIO_STATE })
    public void addOnDevicesForAttributesChangedListener(AudioAttributes attributes,
            IDevicesForAttributesCallback callback) {
        super.addOnDevicesForAttributesChangedListener_enforcePermission();
        mAudioSystem.addOnDevicesForAttributesChangedListener(
                attributes, false /* forVolume */, callback);
    }