1 /*
2  * Copyright (C) 2014 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 package android.media;
17 
18 import android.util.IntArray;
19 import com.android.server.LocalServices;
20 
21 /**
22  * Class for system services to access extra AudioManager functionality. The
23  * AudioService is responsible for registering an implementation with
24  * {@link LocalServices}.
25  *
26  * @hide
27  */
28 public abstract class AudioManagerInternal {
29 
adjustSuggestedStreamVolumeForUid(int streamType, int direction, int flags, String callingPackage, int uid)30     public abstract void adjustSuggestedStreamVolumeForUid(int streamType, int direction,
31             int flags, String callingPackage, int uid);
32 
adjustStreamVolumeForUid(int streamType, int direction, int flags, String callingPackage, int uid)33     public abstract void adjustStreamVolumeForUid(int streamType, int direction, int flags,
34             String callingPackage, int uid);
35 
setStreamVolumeForUid(int streamType, int direction, int flags, String callingPackage, int uid)36     public abstract void setStreamVolumeForUid(int streamType, int direction, int flags,
37             String callingPackage, int uid);
38 
setRingerModeDelegate(RingerModeDelegate delegate)39     public abstract void setRingerModeDelegate(RingerModeDelegate delegate);
40 
getRingerModeInternal()41     public abstract int getRingerModeInternal();
42 
setRingerModeInternal(int ringerMode, String caller)43     public abstract void setRingerModeInternal(int ringerMode, String caller);
44 
updateRingerModeAffectedStreamsInternal()45     public abstract void updateRingerModeAffectedStreamsInternal();
46 
setAccessibilityServiceUids(IntArray uids)47     public abstract void setAccessibilityServiceUids(IntArray uids);
48 
49     public interface RingerModeDelegate {
50         /** Called when external ringer mode is evaluated, returns the new internal ringer mode */
onSetRingerModeExternal(int ringerModeOld, int ringerModeNew, String caller, int ringerModeInternal, VolumePolicy policy)51         int onSetRingerModeExternal(int ringerModeOld, int ringerModeNew, String caller,
52                 int ringerModeInternal, VolumePolicy policy);
53 
54         /** Called when internal ringer mode is evaluated, returns the new external ringer mode */
onSetRingerModeInternal(int ringerModeOld, int ringerModeNew, String caller, int ringerModeExternal, VolumePolicy policy)55         int onSetRingerModeInternal(int ringerModeOld, int ringerModeNew, String caller,
56                 int ringerModeExternal, VolumePolicy policy);
57 
canVolumeDownEnterSilent()58         boolean canVolumeDownEnterSilent();
59 
getRingerModeAffectedStreams(int streams)60         int getRingerModeAffectedStreams(int streams);
61     }
62 }
63