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.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 
     30     public abstract void adjustSuggestedStreamVolumeForUid(int streamType, int direction,
     31             int flags, String callingPackage, int uid);
     32 
     33     public abstract void adjustStreamVolumeForUid(int streamType, int direction, int flags,
     34             String callingPackage, int uid);
     35 
     36     public abstract void setStreamVolumeForUid(int streamType, int direction, int flags,
     37             String callingPackage, int uid);
     38 
     39     public abstract void setRingerModeDelegate(RingerModeDelegate delegate);
     40 
     41     public abstract int getRingerModeInternal();
     42 
     43     public abstract void setRingerModeInternal(int ringerMode, String caller);
     44 
     45     public abstract void silenceRingerModeInternal(String caller);
     46 
     47     public abstract void updateRingerModeAffectedStreamsInternal();
     48 
     49     public abstract void setAccessibilityServiceUids(IntArray uids);
     50 
     51     public interface RingerModeDelegate {
     52         /** Called when external ringer mode is evaluated, returns the new internal ringer mode */
     53         int onSetRingerModeExternal(int ringerModeOld, int ringerModeNew, String caller,
     54                 int ringerModeInternal, VolumePolicy policy);
     55 
     56         /** Called when internal ringer mode is evaluated, returns the new external ringer mode */
     57         int onSetRingerModeInternal(int ringerModeOld, int ringerModeNew, String caller,
     58                 int ringerModeExternal, VolumePolicy policy);
     59 
     60         boolean canVolumeDownEnterSilent();
     61 
     62         int getRingerModeAffectedStreams(int streams);
     63     }
     64 }
     65