summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Amith Yamasani <yamasani@google.com> 2011-11-29 16:32:17 -0800
committer Amith Yamasani <yamasani@google.com> 2011-11-30 15:28:43 -0800
commit2b0acc90ae5a1133356b3af43d99056de1b3f626 (patch)
treeb1ec75ddd9e1264ddabb72ee0952810e4a3b1a73
parente5715521232443f01f8c0c0633cac364c8136bde (diff)
No clicking on volume icon in volume dialog.
Don't disable volume slider when it hits zero. Show correct icon for Silent mode in Power menu. Bug: 5586083 Change-Id: Iaa957fc08e314e0de1c007dfc967a1d960080aab
-rw-r--r--core/java/android/view/VolumePanel.java22
-rw-r--r--policy/src/com/android/internal/policy/impl/GlobalActions.java4
2 files changed, 2 insertions, 24 deletions
diff --git a/core/java/android/view/VolumePanel.java b/core/java/android/view/VolumePanel.java
index b657204d02fa..48fe0df89577 100644
--- a/core/java/android/view/VolumePanel.java
+++ b/core/java/android/view/VolumePanel.java
@@ -278,10 +278,6 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
}
private void createSliders() {
- final int silentableStreams = System.getInt(mContext.getContentResolver(),
- System.MODE_RINGER_STREAMS_AFFECTED,
- ((1 << AudioSystem.STREAM_NOTIFICATION) | (1 << AudioSystem.STREAM_RING)));
-
LayoutInflater inflater = (LayoutInflater) mContext
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mStreamControls = new HashMap<Integer, StreamControl>(STREAMS.length);
@@ -297,9 +293,6 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
sc.group = (ViewGroup) inflater.inflate(R.layout.volume_adjust_item, null);
sc.group.setTag(sc);
sc.icon = (ImageView) sc.group.findViewById(R.id.stream_icon);
- if ((silentableStreams & (1 << sc.streamType)) != 0) {
- sc.icon.setOnClickListener(this);
- }
sc.icon.setTag(sc);
sc.icon.setContentDescription(res.getString(streamRes.descRes));
sc.iconRes = streamRes.iconRes;
@@ -356,7 +349,6 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
&& mAudioManager.shouldVibrate(AudioManager.VIBRATE_TYPE_RINGER)) {
sc.icon.setImageResource(R.drawable.ic_audio_ring_notif_vibrate);
}
- sc.seekbarView.setEnabled(!muted);
}
private boolean isExpanded() {
@@ -436,8 +428,6 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
mAudioService.getLastAudibleStreamVolume(streamType)
: mAudioService.getStreamVolume(streamType);
-// int message = UNKNOWN_VOLUME_TEXT;
-// int additionalMessage = 0;
mRingIsSilent = false;
if (LOGD) {
@@ -697,18 +687,6 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
public void onClick(View v) {
if (v == mMoreButton) {
expand();
- } else if (v.getTag() instanceof StreamControl) {
- StreamControl sc = (StreamControl) v.getTag();
- boolean vibeInSilent = Settings.System.getInt(mContext.getContentResolver(),
- System.VIBRATE_IN_SILENT, 1) == 1;
- int newMode = mAudioManager.isSilentMode()
- ? AudioManager.RINGER_MODE_NORMAL
- : (vibeInSilent
- ? AudioManager.RINGER_MODE_VIBRATE
- : AudioManager.RINGER_MODE_SILENT);
- mAudioManager.setRingerMode(newMode);
- // Expand the dialog if it hasn't been expanded yet.
- if (mShowCombinedVolumes && !isExpanded()) expand();
}
resetTimeout();
}
diff --git a/policy/src/com/android/internal/policy/impl/GlobalActions.java b/policy/src/com/android/internal/policy/impl/GlobalActions.java
index f040e87b7bae..8052c8027859 100644
--- a/policy/src/com/android/internal/policy/impl/GlobalActions.java
+++ b/policy/src/com/android/internal/policy/impl/GlobalActions.java
@@ -121,8 +121,8 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
R.string.global_action_silent_mode_off_status) {
void willCreate() {
- mEnabledIconResId = (Settings.System.getInt(mContext.getContentResolver(),
- Settings.System.VIBRATE_IN_SILENT, 1) == 1)
+ mEnabledIconResId =
+ mAudioManager.getRingerMode() == AudioManager.RINGER_MODE_VIBRATE
? R.drawable.ic_audio_ring_notif_vibrate
: R.drawable.ic_audio_vol_mute;
}