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