Loading media/java/android/media/AudioService.java +2 −8 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import static android.media.AudioManager.RINGER_MODE_SILENT; import static android.media.AudioManager.RINGER_MODE_VIBRATE; import android.app.ActivityManagerNative; import android.app.KeyguardManager; import android.app.PendingIntent; import android.app.PendingIntent.CanceledException; import android.bluetooth.BluetoothA2dp; Loading Loading @@ -320,8 +319,6 @@ public class AudioService extends IAudioService.Stub { private static final int NOTIFICATION_VOLUME_DELAY_MS = 5000; // previous volume adjustment direction received by checkForRingerModeChange() private int mPrevVolDirection = AudioManager.ADJUST_SAME; // Keyguard manager proxy private KeyguardManager mKeyguardManager; /////////////////////////////////////////////////////////////////////////// // Construction Loading Loading @@ -506,10 +503,9 @@ public class AudioService extends IAudioService.Stub { streamType = getActiveStreamType(suggestedStreamType); } // Play sounds on STREAM_RING only and if lock screen is not on. // Play sounds on STREAM_RING only. if ((flags & AudioManager.FLAG_PLAY_SOUND) != 0 && ((STREAM_VOLUME_ALIAS[streamType] != AudioSystem.STREAM_RING) || (mKeyguardManager != null && mKeyguardManager.isKeyguardLocked()))) { ((STREAM_VOLUME_ALIAS[streamType] != AudioSystem.STREAM_RING))) { flags &= ~AudioManager.FLAG_PLAY_SOUND; } Loading Loading @@ -2669,8 +2665,6 @@ public class AudioService extends IAudioService.Stub { sendMsg(mAudioHandler, MSG_LOAD_SOUND_EFFECTS, SHARED_MSG, SENDMSG_NOOP, 0, 0, null, 0); mKeyguardManager = (KeyguardManager)mContext.getSystemService(Context.KEYGUARD_SERVICE); mScoConnectionState = AudioManager.SCO_AUDIO_STATE_ERROR; resetBluetoothSco(); getBluetoothHeadset(); Loading policy/src/com/android/internal/policy/impl/GlobalActions.java +31 −23 Original line number Diff line number Diff line Loading @@ -56,6 +56,8 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac private static final String TAG = "GlobalActions"; private static final boolean SHOW_SILENT_TOGGLE = false; private final Context mContext; private final AudioManager mAudioManager; Loading Loading @@ -187,12 +189,18 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac } }; mItems = Lists.newArrayList( mItems = new ArrayList<Action>(); // silent mode mSilentModeToggle, if (SHOW_SILENT_TOGGLE) { mItems.add(mSilentModeToggle); } // next: airplane mode mAirplaneModeOn, mItems.add(mAirplaneModeOn); // last: power off mItems.add( new SinglePressAction( com.android.internal.R.drawable.ic_lock_power_off, R.string.global_action_power_off) { Loading policy/src/com/android/internal/policy/impl/KeyguardViewBase.java +24 −16 Original line number Diff line number Diff line Loading @@ -46,6 +46,10 @@ public abstract class KeyguardViewBase extends FrameLayout { private KeyguardViewCallback mCallback; private AudioManager mAudioManager; private TelephonyManager mTelephonyManager = null; // Whether the volume keys should be handled by keyguard. If true, then // they will be handled here for specific media types such as music, otherwise // the audio service will bring up the volume dialog. private static final boolean KEYGUARD_MANAGES_VOLUME = false; // This is a faster way to draw the background on devices without hardware acceleration Drawable mBackgroundDrawable = new Drawable() { Loading Loading @@ -203,6 +207,7 @@ public abstract class KeyguardViewBase extends FrameLayout { case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_DOWN: case KeyEvent.KEYCODE_VOLUME_MUTE: { if (KEYGUARD_MANAGES_VOLUME) { synchronized (this) { if (mAudioManager == null) { mAudioManager = (AudioManager) getContext().getSystemService( Loading @@ -221,6 +226,9 @@ public abstract class KeyguardViewBase extends FrameLayout { } // Don't execute default volume behavior return true; } else { return false; } } } } else if (event.getAction() == KeyEvent.ACTION_UP) { Loading Loading
media/java/android/media/AudioService.java +2 −8 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import static android.media.AudioManager.RINGER_MODE_SILENT; import static android.media.AudioManager.RINGER_MODE_VIBRATE; import android.app.ActivityManagerNative; import android.app.KeyguardManager; import android.app.PendingIntent; import android.app.PendingIntent.CanceledException; import android.bluetooth.BluetoothA2dp; Loading Loading @@ -320,8 +319,6 @@ public class AudioService extends IAudioService.Stub { private static final int NOTIFICATION_VOLUME_DELAY_MS = 5000; // previous volume adjustment direction received by checkForRingerModeChange() private int mPrevVolDirection = AudioManager.ADJUST_SAME; // Keyguard manager proxy private KeyguardManager mKeyguardManager; /////////////////////////////////////////////////////////////////////////// // Construction Loading Loading @@ -506,10 +503,9 @@ public class AudioService extends IAudioService.Stub { streamType = getActiveStreamType(suggestedStreamType); } // Play sounds on STREAM_RING only and if lock screen is not on. // Play sounds on STREAM_RING only. if ((flags & AudioManager.FLAG_PLAY_SOUND) != 0 && ((STREAM_VOLUME_ALIAS[streamType] != AudioSystem.STREAM_RING) || (mKeyguardManager != null && mKeyguardManager.isKeyguardLocked()))) { ((STREAM_VOLUME_ALIAS[streamType] != AudioSystem.STREAM_RING))) { flags &= ~AudioManager.FLAG_PLAY_SOUND; } Loading Loading @@ -2669,8 +2665,6 @@ public class AudioService extends IAudioService.Stub { sendMsg(mAudioHandler, MSG_LOAD_SOUND_EFFECTS, SHARED_MSG, SENDMSG_NOOP, 0, 0, null, 0); mKeyguardManager = (KeyguardManager)mContext.getSystemService(Context.KEYGUARD_SERVICE); mScoConnectionState = AudioManager.SCO_AUDIO_STATE_ERROR; resetBluetoothSco(); getBluetoothHeadset(); Loading
policy/src/com/android/internal/policy/impl/GlobalActions.java +31 −23 Original line number Diff line number Diff line Loading @@ -56,6 +56,8 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac private static final String TAG = "GlobalActions"; private static final boolean SHOW_SILENT_TOGGLE = false; private final Context mContext; private final AudioManager mAudioManager; Loading Loading @@ -187,12 +189,18 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac } }; mItems = Lists.newArrayList( mItems = new ArrayList<Action>(); // silent mode mSilentModeToggle, if (SHOW_SILENT_TOGGLE) { mItems.add(mSilentModeToggle); } // next: airplane mode mAirplaneModeOn, mItems.add(mAirplaneModeOn); // last: power off mItems.add( new SinglePressAction( com.android.internal.R.drawable.ic_lock_power_off, R.string.global_action_power_off) { Loading
policy/src/com/android/internal/policy/impl/KeyguardViewBase.java +24 −16 Original line number Diff line number Diff line Loading @@ -46,6 +46,10 @@ public abstract class KeyguardViewBase extends FrameLayout { private KeyguardViewCallback mCallback; private AudioManager mAudioManager; private TelephonyManager mTelephonyManager = null; // Whether the volume keys should be handled by keyguard. If true, then // they will be handled here for specific media types such as music, otherwise // the audio service will bring up the volume dialog. private static final boolean KEYGUARD_MANAGES_VOLUME = false; // This is a faster way to draw the background on devices without hardware acceleration Drawable mBackgroundDrawable = new Drawable() { Loading Loading @@ -203,6 +207,7 @@ public abstract class KeyguardViewBase extends FrameLayout { case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_DOWN: case KeyEvent.KEYCODE_VOLUME_MUTE: { if (KEYGUARD_MANAGES_VOLUME) { synchronized (this) { if (mAudioManager == null) { mAudioManager = (AudioManager) getContext().getSystemService( Loading @@ -221,6 +226,9 @@ public abstract class KeyguardViewBase extends FrameLayout { } // Don't execute default volume behavior return true; } else { return false; } } } } else if (event.getAction() == KeyEvent.ACTION_UP) { Loading