Build 1.0_r1(from source)

android.view
Class VolumePanel

java.lang.Object
  extended by android.os.Handler
      extended by android.view.VolumePanel

public class VolumePanel
extends Handler

Handle the volume up and down keys. This code really should be moved elsewhere.


Field Summary
protected  AudioService mAudioService
           
protected  Context mContext
           
static int PLAY_SOUND_DELAY
          The delay before playing a sound.
static int VIBRATE_DELAY
          The delay before vibrating.
 
Constructor Summary
VolumePanel(Context context, AudioService volumeService)
           
 
Method Summary
 void handleMessage(Message msg)
          Subclasses must implement this to receive messages.
protected  void onFreeResources()
           
protected  void onPlaySound(int streamType, int flags)
           
protected  void onShowVolumeChanged(int streamType, int flags)
           
protected  void onStopSounds()
           
protected  void onVibrate()
           
protected  void onVolumeChanged(int streamType, int flags)
          Override this if you have other work to do when the volume changes (for example, vibrating, playing a sound, etc.).
 void postVolumeChanged(int streamType, int flags)
           
 
Methods inherited from class android.os.Handler
dispatchMessage, dump, getLooper, hasMessages, hasMessages, obtainMessage, obtainMessage, obtainMessage, obtainMessage, obtainMessage, post, postAtFrontOfQueue, postAtTime, postAtTime, postDelayed, removeCallbacks, removeCallbacks, removeCallbacksAndMessages, removeMessages, removeMessages, sendEmptyMessage, sendEmptyMessageAtTime, sendEmptyMessageDelayed, sendMessage, sendMessageAtFrontOfQueue, sendMessageAtTime, sendMessageDelayed, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PLAY_SOUND_DELAY

public static final int PLAY_SOUND_DELAY
The delay before playing a sound. This small period exists so the user can press another key (non-volume keys, too) to have it NOT be audible.

PhoneWindow will implement this part.

See Also:
Constant Field Values

VIBRATE_DELAY

public static final int VIBRATE_DELAY
The delay before vibrating. This small period exists so if the user is moving to silent mode, it will not emit a short vibrate (it normally would since vibrate is between normal mode and silent mode using hardware keys).

See Also:
Constant Field Values

mContext

protected Context mContext

mAudioService

protected AudioService mAudioService
Constructor Detail

VolumePanel

public VolumePanel(Context context,
                   AudioService volumeService)
Method Detail

postVolumeChanged

public void postVolumeChanged(int streamType,
                              int flags)

onVolumeChanged

protected void onVolumeChanged(int streamType,
                               int flags)
Override this if you have other work to do when the volume changes (for example, vibrating, playing a sound, etc.). Make sure to call through to the superclass implementation.


onShowVolumeChanged

protected void onShowVolumeChanged(int streamType,
                                   int flags)

onPlaySound

protected void onPlaySound(int streamType,
                           int flags)

onStopSounds

protected void onStopSounds()

onVibrate

protected void onVibrate()

onFreeResources

protected void onFreeResources()

handleMessage

public void handleMessage(Message msg)
Description copied from class: Handler
Subclasses must implement this to receive messages.

Overrides:
handleMessage in class Handler

Build 1.0_r1(from source)

Please submit a feedback, bug or feature