1/* Copyright (C) 2014 The Android Open Source Project
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *      http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16package android.media.session;
17
18import android.content.ComponentName;
19import android.media.IRemoteVolumeController;
20import android.media.session.IActiveSessionsListener;
21import android.media.session.ISession;
22import android.media.session.ISessionCallback;
23import android.os.Bundle;
24import android.view.KeyEvent;
25
26/**
27 * Interface to the MediaSessionManagerService
28 * @hide
29 */
30interface ISessionManager {
31    ISession createSession(String packageName, in ISessionCallback cb, String tag, int userId);
32    List<IBinder> getSessions(in ComponentName compName, int userId);
33    void dispatchMediaKeyEvent(in KeyEvent keyEvent, boolean needWakeLock);
34    void dispatchAdjustVolume(int suggestedStream, int delta, int flags);
35    void addSessionsListener(in IActiveSessionsListener listener, in ComponentName compName,
36            int userId);
37    void removeSessionsListener(in IActiveSessionsListener listener);
38
39    // This is for the system volume UI only
40    void setRemoteVolumeController(in IRemoteVolumeController rvc);
41
42    // For PhoneWindowManager to precheck media keys
43    boolean isGlobalPriorityActive();
44}