1 /*
2  * Copyright 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.media;
18 
19 import android.os.Bundle;
20 import android.os.ResultReceiver;
21 import android.media.Session2Command;
22 
23 /**
24  * Interface from MediaSession2 to MediaController2.
25  * <p>
26  * Keep this interface oneway. Otherwise a malicious app may implement fake version of this,
27  * and holds calls from session to make session owner(s) frozen.
28  * @hide
29  */
30  // Code for AML only
31 oneway interface IMediaController2 {
notifyConnected(int seq, in Bundle connectionResult)32     void notifyConnected(int seq, in Bundle connectionResult) = 0;
notifyDisconnected(int seq)33     void notifyDisconnected(int seq) = 1;
notifyPlaybackActiveChanged(int seq, boolean playbackActive)34     void notifyPlaybackActiveChanged(int seq, boolean playbackActive) = 2;
sendSessionCommand(int seq, in Session2Command command, in Bundle args, in ResultReceiver resultReceiver)35     void sendSessionCommand(int seq, in Session2Command command, in Bundle args,
36             in ResultReceiver resultReceiver) = 3;
cancelSessionCommand(int seq)37     void cancelSessionCommand(int seq) = 4;
38     // Next Id : 5
39 }
40