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.Controller2Link; 22 import android.media.Session2Command; 23 24 /** 25 * Interface from MediaController2 to MediaSession2. 26 * <p> 27 * Keep this interface oneway. Otherwise a malicious app may implement fake version of this, 28 * and holds calls from session to make session owner(s) frozen. 29 * @hide 30 */ 31 // Code for AML only 32 oneway interface IMediaSession2 { connect(in Controller2Link caller, int seq, in Bundle connectionRequest)33 void connect(in Controller2Link caller, int seq, in Bundle connectionRequest) = 0; disconnect(in Controller2Link caller, int seq)34 void disconnect(in Controller2Link caller, int seq) = 1; sendSessionCommand(in Controller2Link caller, int seq, in Session2Command sessionCommand, in Bundle args, in ResultReceiver resultReceiver)35 void sendSessionCommand(in Controller2Link caller, int seq, in Session2Command sessionCommand, 36 in Bundle args, in ResultReceiver resultReceiver) = 2; cancelSessionCommand(in Controller2Link caller, int seq)37 void cancelSessionCommand(in Controller2Link caller, int seq) = 3; 38 // Next Id : 4 39 } 40