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

Commit 8504ee89 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

Simplify method management for IAudioService

Move all the methods called from native to the beginning,
so adding new Java-only methods does not affect transaction IDs
of methods called from native.

Also, remove unused imports from IAudioService.aidl

Bug: 72256604
Test: Loopback test in Java, OpenSL ES, and AAudio modes
Change-Id: Icc89e3ed7a052c26eb0e72ba31e3a4a973bcfd35
parent 4f07fa4e
Loading
Loading
Loading
Loading
+14 −15
Original line number Diff line number Diff line
@@ -16,9 +16,7 @@

package android.media;

import android.app.PendingIntent;
import android.bluetooth.BluetoothDevice;
import android.content.ComponentName;
import android.media.AudioAttributes;
import android.media.AudioFocusInfo;
import android.media.AudioPlaybackConfiguration;
@@ -31,25 +29,33 @@ import android.media.IRecordingConfigDispatcher;
import android.media.IRingtonePlayer;
import android.media.IVolumeController;
import android.media.PlayerBase;
import android.media.Rating;
import android.media.VolumePolicy;
import android.media.audiopolicy.AudioPolicyConfig;
import android.media.audiopolicy.IAudioPolicyCallback;
import android.net.Uri;
import android.view.KeyEvent;

/**
 * {@hide}
 */
interface IAudioService {
    // C++ and Java methods below.

    // WARNING: When methods are inserted or deleted, the transaction IDs in
    // WARNING: When methods are inserted or deleted in this section, the transaction IDs in
    // frameworks/native/include/audiomanager/IAudioManager.h must be updated to match the order
    // in this file.
    //
    // When a method's argument list is changed, BpAudioManager's corresponding serialization code
    // (if any) in frameworks/native/services/audiomanager/IAudioManager.cpp must be updated.

    int trackPlayer(in PlayerBase.PlayerIdCard pic);

    oneway void playerAttributes(in int piid, in AudioAttributes attr);

    oneway void playerEvent(in int piid, in int event);

    oneway void releasePlayer(in int piid);

    // Java-only methods below.

    oneway void adjustSuggestedStreamVolume(int direction, int suggestedStreamType, int flags,
            String callingPackage, String caller);

@@ -187,14 +193,6 @@ interface IAudioService {

    List<AudioPlaybackConfiguration> getActivePlaybackConfigurations();

    int trackPlayer(in PlayerBase.PlayerIdCard pic);

    oneway void playerAttributes(in int piid, in AudioAttributes attr);

    oneway void playerEvent(in int piid, in int event);

    oneway void releasePlayer(in int piid);

    void disableRingtoneSync(in int userId);

    int getFocusRampTimeMs(in int focusGain, in AudioAttributes attr);
@@ -210,5 +208,6 @@ interface IAudioService {
    oneway void setFocusRequestResultFromExtPolicy(in AudioFocusInfo afi, int requestResult,
            in IAudioPolicyCallback pcb);

    // WARNING: read warning at top of file, it is recommended to add new methods at the end
    // WARNING: read warning at top of file, new methods that need to be used by native
    // code via IAudioManager.h need to be added to the top section.
}