IT. Expert System.

Android Reference

AudioService


android.media

Class AudioService

  • All Implemented Interfaces:
    PendingIntent.OnFinished


    public class AudioService
    extends IAudioService.Stub
    implements PendingIntent.OnFinished
    The implementation of the volume manager service.

    This implementation focuses on delivering a responsive UI. Most methods are asynchronous to external calls. For example, the task of setting a volume will update our internal state, but in a separate thread will set the system volume and later persist to the database. Similarly, setting the ringer mode will update the state and broadcast a change and in a separate thread later persist the ringer mode.

    • Field Detail

      • DEBUG_RC

        protected static final boolean DEBUG_RC
        Debug remote control client/display feature
        See Also:
        Constant Field Values
      • STREAM_REMOTE_MUSIC

        public static final int STREAM_REMOTE_MUSIC
        A fake stream type to match the notion of remote media playback
        See Also:
        Constant Field Values
    • Constructor Detail

      • AudioService

        public AudioService(Context context)
    • Method Detail

      • adjustSuggestedStreamVolume

        public void adjustSuggestedStreamVolume(int direction,
                                       int suggestedStreamType,
                                       int flags)
        See Also:
        AudioManager#adjustVolume(int, int, int)
      • adjustMasterVolume

        public void adjustMasterVolume(int steps,
                              int flags)
        See Also:
        AudioManager#adjustMasterVolume(int)
      • isStreamMute

        public boolean isStreamMute(int streamType)
        get stream mute state.
      • setMasterMute

        public void setMasterMute(boolean state,
                         int flags,
                         IBinder cb)
        See Also:
        AudioManager#setMasterMute(boolean, IBinder)
      • isMasterMute

        public boolean isMasterMute()
        get master mute state.
      • getMasterVolume

        public int getMasterVolume()
      • setMasterVolume

        public void setMasterVolume(int volume,
                           int flags)
      • getMasterMaxVolume

        public int getMasterMaxVolume()
      • getLastAudibleStreamVolume

        public int getLastAudibleStreamVolume(int streamType)
        Get last audible volume before stream was muted.
      • getLastAudibleMasterVolume

        public int getLastAudibleMasterVolume()
        Get last audible master volume before it was muted.
      • getMasterStreamType

        public int getMasterStreamType()
        See Also:
        AudioManager#getMasterStreamType(int)
      • getValueForVibrateSetting

        public static int getValueForVibrateSetting(int existingValue,
                                    int vibrateType,
                                    int vibrateSetting)
        See Also:
        setVibrateSetting(int, int)
      • loadSoundEffects

        public boolean loadSoundEffects()
        Loads samples into the soundpool. This method must be called at first when sound effects are enabled
      • unloadSoundEffects

        public void unloadSoundEffects()
        Unloads samples from the sound pool. This method can be called to free some memory when sound effects are disabled.
      • setSpeakerphoneOn

        public void setSpeakerphoneOn(boolean on)
        See Also:
        AudioManager#setSpeakerphoneOn()
      • setBluetoothScoOn

        public void setBluetoothScoOn(boolean on)
        See Also:
        AudioManager#setBluetoothScoOn()
      • setBluetoothA2dpOn

        public void setBluetoothA2dpOn(boolean on)
        See Also:
        AudioManager#setBluetoothA2dpOn()
      • clearAllScoClients

        public void clearAllScoClients(int exceptPid,
                              boolean stopSco)
      • setRemoteSubmixOn

        public void setRemoteSubmixOn(boolean on,
                             int address)
        see AudioManager.setRemoteSubmixOn(boolean on)
      • isStreamAffectedByRingerMode

        public boolean isStreamAffectedByRingerMode(int streamType)
      • isStreamAffectedByMute

        public boolean isStreamAffectedByMute(int streamType)
      • setWiredDeviceConnectionState

        public void setWiredDeviceConnectionState(int device,
                                         int state,
                                         String name)
      • setBluetoothA2dpDeviceConnectionState

        public int setBluetoothA2dpDeviceConnectionState(BluetoothDevice device,
                                                int state)
      • requestAudioFocus

        public int requestAudioFocus(int mainStreamType,
                            int focusChangeHint,
                            IBinder cb,
                            IAudioFocusDispatcher fd,
                            String clientId,
                            String callingPackageName)
        See Also:
        AudioManager#requestAudioFocus(IAudioFocusDispatcher, int, int)
      • abandonAudioFocus

        public int abandonAudioFocus(IAudioFocusDispatcher fl,
                            String clientId)
        See Also:
        AudioManager#abandonAudioFocus(IAudioFocusDispatcher)
      • unregisterAudioFocusClient

        public void unregisterAudioFocusClient(String clientId)
      • dispatchMediaKeyEvent

        public void dispatchMediaKeyEvent(KeyEvent keyEvent)
      • dispatchMediaKeyEventUnderWakelock

        public void dispatchMediaKeyEventUnderWakelock(KeyEvent keyEvent)
      • onSendFinished

        public void onSendFinished(PendingIntent pendingIntent,
                          Intent intent,
                          int resultCode,
                          String resultData,
                          Bundle resultExtras)
        Description copied from interface: PendingIntent.OnFinished
        Called when a send operation as completed.
        Specified by:
        onSendFinished in interface PendingIntent.OnFinished
        Parameters:
        pendingIntent - The PendingIntent this operation was sent through.
        intent - The original Intent that was sent.
        resultCode - The final result code determined by the send.
        resultData - The final data collected by a broadcast.
        resultExtras - The final extras collected by a broadcast.
      • registerMediaButtonIntent

        public void registerMediaButtonIntent(PendingIntent mediaIntent,
                                     ComponentName eventReceiver)
        see AudioManager.registerMediaButtonIntent(PendingIntent pi, ComponentName c) precondition: mediaIntent != null, target != null
      • unregisterMediaButtonIntent

        public void unregisterMediaButtonIntent(PendingIntent mediaIntent,
                                       ComponentName eventReceiver)
        see AudioManager.unregisterMediaButtonIntent(PendingIntent mediaIntent) precondition: mediaIntent != null, eventReceiver != null
      • registerMediaButtonEventReceiverForCalls

        public void registerMediaButtonEventReceiverForCalls(ComponentName c)
        see AudioManager.registerMediaButtonEventReceiverForCalls(ComponentName c) precondition: c != null
      • unregisterMediaButtonEventReceiverForCalls

        public void unregisterMediaButtonEventReceiverForCalls()
        see AudioManager.unregisterMediaButtonEventReceiverForCalls()
      • registerRemoteControlClient

        public int registerRemoteControlClient(PendingIntent mediaIntent,
                                      IRemoteControlClient rcClient,
                                      String callingPackageName)
        see AudioManager.registerRemoteControlClient(ComponentName eventReceiver, ...)
        Returns:
        the unique ID of the RemoteControlStackEntry associated with the RemoteControlClient Note: using this method with rcClient == null is a way to "disable" the IRemoteControlClient without modifying the RC stack, but while still causing the display to refresh (will become blank as a result of this)
      • unregisterRemoteControlClient

        public void unregisterRemoteControlClient(PendingIntent mediaIntent,
                                         IRemoteControlClient rcClient)
        see AudioManager.unregisterRemoteControlClient(PendingIntent pi, ...) rcClient is guaranteed non-null
      • registerRemoteControlDisplay

        public void registerRemoteControlDisplay(IRemoteControlDisplay rcd)
        Register an IRemoteControlDisplay. Notify all IRemoteControlClient of the new display and cause the RemoteControlClient at the top of the stack to update the new display with its information. Since only one IRemoteControlDisplay is supported, this will unregister the previous display.
        Parameters:
        rcd - the IRemoteControlDisplay to register. No effect if null.
      • unregisterRemoteControlDisplay

        public void unregisterRemoteControlDisplay(IRemoteControlDisplay rcd)
        Unregister an IRemoteControlDisplay. Since only one IRemoteControlDisplay is supported, this has no effect if the one to unregister is not the current one.
        Parameters:
        rcd - the IRemoteControlDisplay to unregister. No effect if null.
      • remoteControlDisplayUsesBitmapSize

        public void remoteControlDisplayUsesBitmapSize(IRemoteControlDisplay rcd,
                                              int w,
                                              int h)
      • setPlaybackInfoForRcc

        public void setPlaybackInfoForRcc(int rccId,
                                 int what,
                                 int value)
      • registerRemoteVolumeObserverForRcc

        public void registerRemoteVolumeObserverForRcc(int rccId,
                                              IRemoteVolumeObserver rvo)
      • getRemoteStreamMaxVolume

        public int getRemoteStreamMaxVolume()
      • getRemoteStreamVolume

        public int getRemoteStreamVolume()
      • setRemoteStreamVolume

        public void setRemoteStreamVolume(int vol)
      • setBluetoothA2dpOnInt

        public void setBluetoothA2dpOnInt(boolean on)
      • setRingtonePlayer

        public void setRingtonePlayer(IRingtonePlayer player)
      • getRingtonePlayer

        public IRingtonePlayer getRingtonePlayer()
      • startWatchingRoutes

        public AudioRoutesInfo startWatchingRoutes(IAudioRoutesObserver observer)
      • disableSafeMediaVolume

        public void disableSafeMediaVolume()
      • isCameraSoundForced

        public boolean isCameraSoundForced()


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 2200 / 96487999. Delta: 0.05030 с