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