summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2011-07-22 10:34:27 -0700
committerAmith Yamasani <yamasani@google.com>2011-08-01 16:45:28 -0700
commit42722bfa136f5616872a2c4e199813e804621c81 (patch)
tree5565d49a2860b018d62ccfcb27491f178e51a91b
parent34e1fb1ee229a7e033dcd42f4efd194e1614d5ce (diff)
downloadframeworks_base-42722bfa136f5616872a2c4e199813e804621c81.zip
frameworks_base-42722bfa136f5616872a2c4e199813e804621c81.tar.gz
frameworks_base-42722bfa136f5616872a2c4e199813e804621c81.tar.bz2
Volume panel changes.
Combined volume panel only in tablets. On phones show active volume. Added dummy assets for ring+notification icon. Deprecated the NOTIFICATION_USES_RING_VOLUME. Now they are always tied together. Audio manager changes still required to ensure that. Initialize all feedback sounds to true. Change-Id: I3ad7890c9be9334eedb5f3b709a4b6995fe24638
-rw-r--r--core/java/android/provider/Settings.java15
-rw-r--r--core/java/android/view/VolumePanel.java128
-rw-r--r--core/res/res/drawable-hdpi/ic_audio_ring_notif.pngbin0 -> 4450 bytes
-rw-r--r--core/res/res/drawable-hdpi/ic_audio_ring_notif_mute.pngbin0 -> 4850 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_audio_ring_notif.pngbin0 -> 3910 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_audio_ring_notif_mute.pngbin0 -> 4094 bytes
-rw-r--r--core/res/res/layout/volume_adjust.xml1
-rwxr-xr-xcore/res/res/values/strings.xml13
-rw-r--r--packages/SettingsProvider/res/values/defaults.xml6
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java92
10 files changed, 112 insertions, 143 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index d3ff8f8..a6c3387 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -1445,17 +1445,16 @@ public final class Settings {
public static final String VOLUME_BLUETOOTH_SCO = "volume_bluetooth_sco";
/**
- * Whether the notifications should use the ring volume (value of 1) or
- * a separate notification volume (value of 0). In most cases, users
- * will have this enabled so the notification and ringer volumes will be
- * the same. However, power users can disable this and use the separate
- * notification volume control.
+ * Whether the notifications should use the ring volume (value of 1) or a separate
+ * notification volume (value of 0). In most cases, users will have this enabled so the
+ * notification and ringer volumes will be the same. However, power users can disable this
+ * and use the separate notification volume control.
* <p>
- * Note: This is a one-off setting that will be removed in the future
- * when there is profile support. For this reason, it is kept hidden
- * from the public APIs.
+ * Note: This is a one-off setting that will be removed in the future when there is profile
+ * support. For this reason, it is kept hidden from the public APIs.
*
* @hide
+ * @deprecated
*/
public static final String NOTIFICATIONS_USE_RING_VOLUME =
"notifications_use_ring_volume";
diff --git a/core/java/android/view/VolumePanel.java b/core/java/android/view/VolumePanel.java
index 9e9f46f..08ccd94 100644
--- a/core/java/android/view/VolumePanel.java
+++ b/core/java/android/view/VolumePanel.java
@@ -89,30 +89,16 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
private static final int MSG_TIMEOUT = 5;
private static final int MSG_RINGER_MODE_CHANGED = 6;
-// private static final int RINGTONE_VOLUME_TEXT = com.android.internal.R.string.volume_ringtone;
-// private static final int MUSIC_VOLUME_TEXT = com.android.internal.R.string.volume_music;
-// private static final int INCALL_VOLUME_TEXT = com.android.internal.R.string.volume_call;
-// private static final int ALARM_VOLUME_TEXT = com.android.internal.R.string.volume_alarm;
-// private static final int UNKNOWN_VOLUME_TEXT = com.android.internal.R.string.volume_unknown;
-// private static final int NOTIFICATION_VOLUME_TEXT =
-// com.android.internal.R.string.volume_notification;
-// private static final int BLUETOOTH_INCALL_VOLUME_TEXT =
-// com.android.internal.R.string.volume_bluetooth_call;
-
protected Context mContext;
private AudioManager mAudioManager;
protected AudioService mAudioService;
private boolean mRingIsSilent;
+ private boolean mShowCombinedVolumes;
/** Dialog containing all the sliders */
private final Dialog mDialog;
/** Dialog's content view */
private final View mView;
-// private final TextView mMessage;
-// private final TextView mAdditionalMessage;
-// private final ImageView mSmallStreamIcon;
-// private final ImageView mLargeStreamIcon;
-// private final ProgressBar mLevel;
/** Contains the sliders and their touchable icons */
private final ViewGroup mSliderGroup;
@@ -127,7 +113,7 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
private HashMap<Integer,StreamControl> mStreamControls;
// List of stream types and their order
- // RING and VOICE_CALL are hidden unless explicitly requested
+ // RING, VOICE_CALL & BLUETOOTH_SCO are hidden unless explicitly requested
private static final int [] STREAM_TYPES = {
AudioManager.STREAM_BLUETOOTH_SCO,
AudioManager.STREAM_RING,
@@ -136,10 +122,18 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
AudioManager.STREAM_NOTIFICATION
};
+ private static final int [] CONTENT_DESCRIPTIONS = {
+ R.string.volume_icon_description_bluetooth,
+ R.string.volume_icon_description_ringer,
+ R.string.volume_icon_description_incall,
+ R.string.volume_icon_description_media,
+ R.string.volume_icon_description_notification
+ };
+
// These icons need to correspond to the ones above.
private static final int [] STREAM_ICONS_NORMAL = {
R.drawable.ic_audio_bt,
- R.drawable.ic_audio_phone,
+ R.drawable.ic_audio_ring_notif,
R.drawable.ic_audio_phone,
R.drawable.ic_audio_vol,
R.drawable.ic_audio_notification,
@@ -148,7 +142,7 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
// These icons need to correspond to the ones above.
private static final int [] STREAM_ICONS_MUTED = {
R.drawable.ic_audio_bt,
- R.drawable.ic_audio_phone,
+ R.drawable.ic_audio_ring_notif_mute,
R.drawable.ic_audio_phone,
R.drawable.ic_audio_vol_mute,
R.drawable.ic_audio_notification_mute,
@@ -184,7 +178,6 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
});
mSliderGroup = (ViewGroup) mView.findViewById(R.id.slider_group);
mMoreButton = (ImageView) mView.findViewById(R.id.expand_button);
- mMoreButton.setOnClickListener(this);
mDivider = (ImageView) mView.findViewById(R.id.expand_button_divider);
mDialog = new Dialog(context, R.style.Theme_Panel_Volume);
@@ -205,16 +198,18 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
window.setAttributes(lp);
window.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
-// mMessage = (TextView) view.findViewById(com.android.internal.R.id.message);
-// mAdditionalMessage =
-// (TextView) view.findViewById(com.android.internal.R.id.additional_message);
-// mSmallStreamIcon = (ImageView) view.findViewById(com.android.internal.R.id.other_stream_icon);
-// mLargeStreamIcon = (ImageView) view.findViewById(com.android.internal.R.id.ringer_stream_icon);
-// mLevel = (ProgressBar) view.findViewById(com.android.internal.R.id.level);
-
mToneGenerators = new ToneGenerator[AudioSystem.getNumStreamTypes()];
mVibrator = new Vibrator();
+ mShowCombinedVolumes = !context.getResources().getBoolean(R.bool.config_voice_capable);
+ // If we don't want to show multiple volumes, hide the settings button and divider
+ if (!mShowCombinedVolumes) {
+ mMoreButton.setVisibility(View.GONE);
+ mDivider.setVisibility(View.GONE);
+ } else {
+ mMoreButton.setOnClickListener(this);
+ }
+
listenToRingerMode();
}
@@ -242,6 +237,7 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
LayoutInflater inflater = (LayoutInflater) mContext
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mStreamControls = new HashMap<Integer,StreamControl>(STREAM_TYPES.length);
+ Resources res = mContext.getResources();
for (int i = 0; i < STREAM_TYPES.length; i++) {
StreamControl sc = new StreamControl();
sc.streamType = STREAM_TYPES[i];
@@ -250,6 +246,7 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
sc.icon = (ImageView) sc.group.findViewById(R.id.stream_icon);
sc.icon.setOnClickListener(this);
sc.icon.setTag(sc);
+ sc.icon.setContentDescription(res.getString(CONTENT_DESCRIPTIONS[i]));
sc.iconRes = STREAM_ICONS_NORMAL[i];
sc.iconMuteRes = STREAM_ICONS_MUTED[i];
sc.icon.setImageResource(sc.iconRes);
@@ -275,13 +272,19 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
updateSlider(active);
}
+ addOtherVolumes();
+ }
+
+ private void addOtherVolumes() {
+ if (!mShowCombinedVolumes) return;
+
for (int i = 0; i < STREAM_TYPES.length; i++) {
// Skip the phone specific ones and the active one
final int streamType = STREAM_TYPES[i];
if (streamType == AudioManager.STREAM_RING
|| streamType == AudioManager.STREAM_VOICE_CALL
|| streamType == AudioManager.STREAM_BLUETOOTH_SCO
- || streamType == activeStreamType) {
+ || streamType == mActiveStreamType) {
continue;
}
StreamControl sc = mStreamControls.get(streamType);
@@ -392,31 +395,23 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
case AudioManager.STREAM_RING: {
// setRingerIcon();
-// message = RINGTONE_VOLUME_TEXT;
Uri ringuri = RingtoneManager.getActualDefaultRingtoneUri(
mContext, RingtoneManager.TYPE_RINGTONE);
if (ringuri == null) {
-// additionalMessage =
-// com.android.internal.R.string.volume_music_hint_silent_ringtone_selected;
mRingIsSilent = true;
}
break;
}
case AudioManager.STREAM_MUSIC: {
-// message = MUSIC_VOLUME_TEXT;
// Special case for when Bluetooth is active for music
if ((mAudioManager.getDevicesForStream(AudioManager.STREAM_MUSIC) &
(AudioManager.DEVICE_OUT_BLUETOOTH_A2DP |
AudioManager.DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES |
AudioManager.DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER)) != 0) {
-// additionalMessage =
-// com.android.internal.R.string.volume_music_hint_playing_through_bluetooth;
-// setLargeIcon(com.android.internal.R.drawable.ic_volume_bluetooth_ad2p);
setMusicIcon(R.drawable.ic_audio_bt, R.drawable.ic_audio_bt_mute);
} else {
setMusicIcon(R.drawable.ic_audio_vol, R.drawable.ic_audio_vol_mute);
-// setSmallIcon(index);
}
break;
}
@@ -429,25 +424,17 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
*/
index++;
max++;
-// message = INCALL_VOLUME_TEXT;
-// setSmallIcon(index);
break;
}
case AudioManager.STREAM_ALARM: {
-// message = ALARM_VOLUME_TEXT;
-// setSmallIcon(index);
break;
}
case AudioManager.STREAM_NOTIFICATION: {
-// message = NOTIFICATION_VOLUME_TEXT;
-// setSmallIcon(index);
Uri ringuri = RingtoneManager.getActualDefaultRingtoneUri(
mContext, RingtoneManager.TYPE_NOTIFICATION);
if (ringuri == null) {
-// additionalMessage =
-// com.android.internal.R.string.volume_music_hint_silent_ringtone_selected;
mRingIsSilent = true;
}
break;
@@ -461,29 +448,10 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
*/
index++;
max++;
-// message = BLUETOOTH_INCALL_VOLUME_TEXT;
-// setLargeIcon(com.android.internal.R.drawable.ic_volume_bluetooth_in_call);
break;
}
}
-// String messageString = Resources.getSystem().getString(message);
-// if (!mMessage.getText().equals(messageString)) {
-// mMessage.setText(messageString);
-// }
-//
-// if (additionalMessage == 0) {
-// mAdditionalMessage.setVisibility(View.GONE);
-// } else {
-// mAdditionalMessage.setVisibility(View.VISIBLE);
-// mAdditionalMessage.setText(Resources.getSystem().getString(additionalMessage));
-// }
-
-// if (max != mLevel.getMax()) {
-// mLevel.setMax(max);
-// }
-// mLevel.setProgress(index);
-
StreamControl sc = mStreamControls.get(streamType);
if (sc != null) {
sc.seekbarView.setProgress(index);
@@ -493,7 +461,9 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
mAudioManager.forceVolumeControlStream(streamType);
mDialog.setContentView(mView);
// Showing dialog - use collapsed state
- collapse();
+ if (mShowCombinedVolumes) {
+ collapse();
+ }
mDialog.show();
}
@@ -566,31 +536,6 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
}
// /**
-// * Makes the small icon visible, and hides the large icon.
-// *
-// * @param index The volume index, where 0 means muted.
-// */
-// private void setSmallIcon(int index) {
-// mLargeStreamIcon.setVisibility(View.GONE);
-// mSmallStreamIcon.setVisibility(View.VISIBLE);
-//
-// mSmallStreamIcon.setImageResource(index == 0
-// ? com.android.internal.R.drawable.ic_volume_off_small
-// : com.android.internal.R.drawable.ic_volume_small);
-// }
-//
-// /**
-// * Makes the large image view visible with the given icon.
-// *
-// * @param resId The icon to display.
-// */
-// private void setLargeIcon(int resId) {
-// mSmallStreamIcon.setVisibility(View.GONE);
-// mLargeStreamIcon.setVisibility(View.VISIBLE);
-// mLargeStreamIcon.setImageResource(resId);
-// }
-//
-// /**
// * Makes the ringer icon visible with an icon that is chosen
// * based on the current ringer mode.
// */
@@ -627,11 +572,6 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
}
protected void onFreeResources() {
- // We'll keep the views, just ditch the cached drawable and hence
- // bitmaps
-// mSmallStreamIcon.setImageDrawable(null);
-// mLargeStreamIcon.setImageDrawable(null);
-
synchronized (this) {
for (int i = mToneGenerators.length - 1; i >= 0; i--) {
if (mToneGenerators[i] != null) {
@@ -718,7 +658,7 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
mAudioManager.setRingerMode(mAudioManager.isSilentMode()
? AudioManager.RINGER_MODE_NORMAL : AudioManager.RINGER_MODE_SILENT);
// Expand the dialog if it hasn't been expanded yet.
- if (!isExpanded()) expand();
+ if (mShowCombinedVolumes && !isExpanded()) expand();
}
resetTimeout();
}
diff --git a/core/res/res/drawable-hdpi/ic_audio_ring_notif.png b/core/res/res/drawable-hdpi/ic_audio_ring_notif.png
new file mode 100644
index 0000000..3938778
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_audio_ring_notif.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_audio_ring_notif_mute.png b/core/res/res/drawable-hdpi/ic_audio_ring_notif_mute.png
new file mode 100644
index 0000000..499c0a3
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_audio_ring_notif_mute.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_audio_ring_notif.png b/core/res/res/drawable-mdpi/ic_audio_ring_notif.png
new file mode 100644
index 0000000..856193b
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_audio_ring_notif.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_audio_ring_notif_mute.png b/core/res/res/drawable-mdpi/ic_audio_ring_notif_mute.png
new file mode 100644
index 0000000..d5d1360
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_audio_ring_notif_mute.png
Binary files differ
diff --git a/core/res/res/layout/volume_adjust.xml b/core/res/res/layout/volume_adjust.xml
index 7303003..8c580c2 100644
--- a/core/res/res/layout/volume_adjust.xml
+++ b/core/res/res/layout/volume_adjust.xml
@@ -54,6 +54,7 @@
android:padding="16dip"
android:background="?attr/selectableItemBackground"
android:src="@drawable/ic_sysbar_quicksettings"
+ android:contentDescription="@string/volume_panel_more_description"
/>
</LinearLayout>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 147fff0..d77b542 100755
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -2552,6 +2552,19 @@
<!-- Title of the dialog where the user is adjusting the general audio volume -->
<string name="volume_unknown">Volume</string>
+ <!-- Content description for bluetooth volume icon [CHAR LIMIT=100] -->
+ <string name="volume_icon_description_bluetooth">Bluetooth volume. Tap to toggle silent mode.</string>
+ <!-- Content description for ringer volume icon [CHAR LIMIT=100] -->
+ <string name="volume_icon_description_ringer">Ringtone volume. Tap to toggle silent mode.</string>
+ <!-- Content description for in-call volume icon [CHAR LIMIT=100] -->
+ <string name="volume_icon_description_incall">Call volume. Tap to toggle silent mode.</string>
+ <!-- Content description for media volume icon [CHAR LIMIT=100] -->
+ <string name="volume_icon_description_media">Media volume. Tap to toggle silent mode.</string>
+ <!-- Content description for notification volume icon [CHAR LIMIT=100] -->
+ <string name="volume_icon_description_notification">Notification volume. Tap to toggle silent mode.</string>
+ <!-- Content description for volume settings expansion button [CHAR LIMIT=100] -->
+ <string name="volume_panel_more_description">Tap to show more audio stream volumes.</string>
+
<!-- Ringtone picker strings --> <skip />
<!-- Choice in the ringtone picker. If chosen, the default ringtone will be used. -->
<string name="ringtone_default">Default ringtone</string>
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml
index c61da4e..12dbdf9 100644
--- a/packages/SettingsProvider/res/values/defaults.xml
+++ b/packages/SettingsProvider/res/values/defaults.xml
@@ -67,7 +67,7 @@
<string name="def_desk_undock_sound" translatable="false">/system/media/audio/ui/Undock.ogg</string>
<string name="def_car_dock_sound" translatable="false">/system/media/audio/ui/Dock.ogg</string>
<string name="def_car_undock_sound" translatable="false">/system/media/audio/ui/Undock.ogg</string>
- <integer name="def_lockscreen_sounds_enabled">0</integer>
+ <integer name="def_lockscreen_sounds_enabled">1</integer>
<string name="def_lock_sound" translatable="false">/system/media/audio/ui/Lock.ogg</string>
<string name="def_unlock_sound" translatable="false">/system/media/audio/ui/Unlock.ogg</string>
@@ -129,4 +129,8 @@
<!-- Default for Settings.System.POINTER_SPEED -->
<integer name="def_pointer_speed">0</integer>
+ <!-- Default for DTMF tones enabled -->
+ <bool name="def_dtmf_tones_enabled">true</bool>
+ <!-- Default for UI touch sounds enabled -->
+ <bool name="def_sound_effects_enabled">true</bool>
</resources>
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index 7fecc9c..f527447 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -63,7 +63,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
// database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
// is properly propagated through your change. Not doing so will result in a loss of user
// settings.
- private static final int DATABASE_VERSION = 68;
+ private static final int DATABASE_VERSION = 69;
private Context mContext;
@@ -862,34 +862,29 @@ public class DatabaseHelper extends SQLiteOpenHelper {
}
if (upgradeVersion == 66) {
- // This upgrade makes sure that MODE_RINGER_STREAMS_AFFECTED and
- // NOTIFICATIONS_USE_RING_VOLUME settings are set according to device voice capability
- db.beginTransaction();
- try {
- int ringerModeAffectedStreams = (1 << AudioManager.STREAM_RING) |
- (1 << AudioManager.STREAM_NOTIFICATION) |
- (1 << AudioManager.STREAM_SYSTEM) |
- (1 << AudioManager.STREAM_SYSTEM_ENFORCED);
- if (!mContext.getResources().getBoolean(
- com.android.internal.R.bool.config_voice_capable)) {
- ringerModeAffectedStreams |= (1 << AudioManager.STREAM_MUSIC);
-
- db.execSQL("DELETE FROM system WHERE name='"
- + Settings.System.NOTIFICATIONS_USE_RING_VOLUME + "'");
- db.execSQL("INSERT INTO system ('name', 'value') values ('"
- + Settings.System.NOTIFICATIONS_USE_RING_VOLUME + "', '1')");
- }
- db.execSQL("DELETE FROM system WHERE name='"
- + Settings.System.MODE_RINGER_STREAMS_AFFECTED + "'");
- db.execSQL("INSERT INTO system ('name', 'value') values ('"
- + Settings.System.MODE_RINGER_STREAMS_AFFECTED + "', '"
- + String.valueOf(ringerModeAffectedStreams) + "')");
- db.setTransactionSuccessful();
- } finally {
- db.endTransaction();
- }
- upgradeVersion = 67;
- }
+ // This upgrade makes sure that MODE_RINGER_STREAMS_AFFECTED is set
+ // according to device voice capability
+ db.beginTransaction();
+ try {
+ int ringerModeAffectedStreams = (1 << AudioManager.STREAM_RING) |
+ (1 << AudioManager.STREAM_NOTIFICATION) |
+ (1 << AudioManager.STREAM_SYSTEM) |
+ (1 << AudioManager.STREAM_SYSTEM_ENFORCED);
+ if (!mContext.getResources().getBoolean(
+ com.android.internal.R.bool.config_voice_capable)) {
+ ringerModeAffectedStreams |= (1 << AudioManager.STREAM_MUSIC);
+ }
+ db.execSQL("DELETE FROM system WHERE name='"
+ + Settings.System.MODE_RINGER_STREAMS_AFFECTED + "'");
+ db.execSQL("INSERT INTO system ('name', 'value') values ('"
+ + Settings.System.MODE_RINGER_STREAMS_AFFECTED + "', '"
+ + String.valueOf(ringerModeAffectedStreams) + "')");
+ db.setTransactionSuccessful();
+ } finally {
+ db.endTransaction();
+ }
+ upgradeVersion = 67;
+ }
if (upgradeVersion == 67) {
// New setting to enable touch exploration.
@@ -909,6 +904,26 @@ public class DatabaseHelper extends SQLiteOpenHelper {
upgradeVersion = 68;
}
+ if (upgradeVersion == 68) {
+ // Enable all system sounds by default
+ db.beginTransaction();
+ SQLiteStatement stmt = null;
+ try {
+ stmt = db.compileStatement("INSERT OR REPLACE INTO system(name,value)"
+ + " VALUES(?,?);");
+ loadDefaultHapticSettings(stmt);
+ loadUISoundEffectsSettings(stmt);
+ db.execSQL("DELETE FROM system WHERE name='"
+ + Settings.System.NOTIFICATIONS_USE_RING_VOLUME + "'");
+ stmt.close();
+ db.setTransactionSuccessful();
+ } finally {
+ db.endTransaction();
+ if (stmt != null)
+ stmt.close();
+ }
+ upgradeVersion = 69;
+ }
// *** Remember to update DATABASE_VERSION above!
@@ -1284,21 +1299,12 @@ public class DatabaseHelper extends SQLiteOpenHelper {
loadSetting(stmt, Settings.Secure.SET_INSTALL_LOCATION, 0);
loadSetting(stmt, Settings.Secure.DEFAULT_INSTALL_LOCATION,
PackageHelper.APP_INSTALL_AUTO);
-
+
loadUISoundEffectsSettings(stmt);
-
+
loadBooleanSetting(stmt, Settings.System.VIBRATE_IN_SILENT,
R.bool.def_vibrate_in_silent);
- // Set notification volume to follow ringer volume by default
- if (mContext.getResources().getBoolean(
- com.android.internal.R.bool.config_voice_capable)) {
- loadBooleanSetting(stmt, Settings.System.NOTIFICATIONS_USE_RING_VOLUME,
- R.bool.def_notifications_use_ring_volume);
- } else {
- loadSetting(stmt, Settings.System.NOTIFICATIONS_USE_RING_VOLUME, "1");
- }
-
loadIntegerSetting(stmt, Settings.System.POINTER_SPEED,
R.integer.def_pointer_speed);
@@ -1312,6 +1318,12 @@ public class DatabaseHelper extends SQLiteOpenHelper {
R.integer.def_power_sounds_enabled);
loadStringSetting(stmt, Settings.System.LOW_BATTERY_SOUND,
R.string.def_low_battery_sound);
+ loadBooleanSetting(stmt, Settings.System.DTMF_TONE_WHEN_DIALING,
+ R.bool.def_dtmf_tones_enabled);
+ loadBooleanSetting(stmt, Settings.System.SOUND_EFFECTS_ENABLED,
+ R.bool.def_sound_effects_enabled);
+ loadBooleanSetting(stmt, Settings.System.HAPTIC_FEEDBACK_ENABLED,
+ R.bool.def_haptic_feedback);
loadIntegerSetting(stmt, Settings.System.DOCK_SOUNDS_ENABLED,
R.integer.def_dock_sounds_enabled);