Merge "New vibrate/silent mode behavior."
This commit is contained in:
committed by
Android (Google) Code Review
commit
7491d8757f
@@ -1278,6 +1278,17 @@ public final class Settings {
|
||||
public static final String NOTIFICATIONS_USE_RING_VOLUME =
|
||||
"notifications_use_ring_volume";
|
||||
|
||||
/**
|
||||
* Whether silent mode should allow vibration feedback. This is used
|
||||
* internally in AudioService and the Sound settings activity to
|
||||
* coordinate decoupling of vibrate and silent modes. This setting
|
||||
* will likely be removed in a future release with support for
|
||||
* audio/vibe feedback profiles.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final String VIBRATE_IN_SILENT = "vibrate_in_silent";
|
||||
|
||||
/**
|
||||
* The mapping of stream type (integer) to its setting.
|
||||
*/
|
||||
|
||||
BIN
core/res/res/drawable-hdpi/ic_jog_dial_vibrate_on.png
Normal file
BIN
core/res/res/drawable-hdpi/ic_jog_dial_vibrate_on.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.2 KiB |
BIN
core/res/res/drawable-mdpi/ic_jog_dial_vibrate_on.png
Normal file
BIN
core/res/res/drawable-mdpi/ic_jog_dial_vibrate_on.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
@@ -901,18 +901,20 @@ public class AudioService extends IAudioService.Stub {
|
||||
boolean adjustVolumeIndex = true;
|
||||
int newRingerMode = mRingerMode;
|
||||
|
||||
if (mRingerMode == AudioManager.RINGER_MODE_NORMAL && (oldIndex + 5) / 10 == 1
|
||||
&& direction == AudioManager.ADJUST_LOWER) {
|
||||
newRingerMode = AudioManager.RINGER_MODE_VIBRATE;
|
||||
} else if (mRingerMode == AudioManager.RINGER_MODE_VIBRATE) {
|
||||
if (direction == AudioManager.ADJUST_RAISE) {
|
||||
newRingerMode = AudioManager.RINGER_MODE_NORMAL;
|
||||
} else if (direction == AudioManager.ADJUST_LOWER) {
|
||||
newRingerMode = AudioManager.RINGER_MODE_SILENT;
|
||||
if (mRingerMode == AudioManager.RINGER_MODE_NORMAL) {
|
||||
// audible mode, at the bottom of the scale
|
||||
if (direction == AudioManager.ADJUST_LOWER
|
||||
&& (oldIndex + 5) / 10 == 1) {
|
||||
// "silent mode", but which one?
|
||||
newRingerMode = System.getInt(mContentResolver, System.VIBRATE_IN_SILENT, 1) == 1
|
||||
? AudioManager.RINGER_MODE_VIBRATE
|
||||
: AudioManager.RINGER_MODE_SILENT;
|
||||
}
|
||||
} else {
|
||||
if (direction == AudioManager.ADJUST_RAISE) {
|
||||
// exiting silent mode
|
||||
newRingerMode = AudioManager.RINGER_MODE_NORMAL;
|
||||
}
|
||||
} else if (direction == AudioManager.ADJUST_RAISE
|
||||
&& mRingerMode == AudioManager.RINGER_MODE_SILENT) {
|
||||
newRingerMode = AudioManager.RINGER_MODE_VIBRATE;
|
||||
}
|
||||
|
||||
if (newRingerMode != mRingerMode) {
|
||||
|
||||
Reference in New Issue
Block a user