Skip to content

Commit b35000f

Browse files
Jim MillerAndroid (Google) Code Review
authored andcommitted
Merge "Attempt to fix missing lock sounds" into jb-mr1-dev
2 parents 3750db1 + b14288d commit b35000f

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,10 +1884,6 @@ private void loadUISoundEffectsSettings(SQLiteStatement stmt) {
18841884

18851885
loadIntegerSetting(stmt, Settings.System.LOCKSCREEN_SOUNDS_ENABLED,
18861886
R.integer.def_lockscreen_sounds_enabled);
1887-
loadStringSetting(stmt, Settings.System.LOCK_SOUND,
1888-
R.string.def_lock_sound);
1889-
loadStringSetting(stmt, Settings.System.UNLOCK_SOUND,
1890-
R.string.def_unlock_sound);
18911887
}
18921888

18931889
private void loadDefaultAnimationSettings(SQLiteStatement stmt) {
@@ -2103,6 +2099,12 @@ private void loadGlobalSettings(SQLiteDatabase db) {
21032099
loadBooleanSetting(stmt, Settings.Global.WIFI_DISPLAY_ON,
21042100
R.bool.def_wifi_display_on);
21052101

2102+
loadStringSetting(stmt, Settings.Global.LOCK_SOUND,
2103+
R.string.def_lock_sound);
2104+
2105+
loadStringSetting(stmt, Settings.Global.UNLOCK_SOUND,
2106+
R.string.def_unlock_sound);
2107+
21062108
// --- New global settings start here
21072109
} finally {
21082110
if (stmt != null) stmt.close();

policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,19 +470,19 @@ public KeyguardViewMediator(Context context, LockPatternUtils lockPatternUtils)
470470
mScreenOn = mPM.isScreenOn();
471471

472472
mLockSounds = new SoundPool(1, AudioManager.STREAM_SYSTEM, 0);
473-
String soundPath = Settings.System.getString(cr, Settings.System.LOCK_SOUND);
473+
String soundPath = Settings.Global.getString(cr, Settings.Global.LOCK_SOUND);
474474
if (soundPath != null) {
475475
mLockSoundId = mLockSounds.load(soundPath, 1);
476476
}
477477
if (soundPath == null || mLockSoundId == 0) {
478-
if (DEBUG) Log.d(TAG, "failed to load sound from " + soundPath);
478+
Log.w(TAG, "failed to load lock sound from " + soundPath);
479479
}
480-
soundPath = Settings.System.getString(cr, Settings.System.UNLOCK_SOUND);
480+
soundPath = Settings.Global.getString(cr, Settings.Global.UNLOCK_SOUND);
481481
if (soundPath != null) {
482482
mUnlockSoundId = mLockSounds.load(soundPath, 1);
483483
}
484484
if (soundPath == null || mUnlockSoundId == 0) {
485-
if (DEBUG) Log.d(TAG, "failed to load sound from " + soundPath);
485+
Log.w(TAG, "failed to load unlock sound from " + soundPath);
486486
}
487487
int lockSoundDefaultAttenuation = context.getResources().getInteger(
488488
com.android.internal.R.integer.config_lockSoundVolumeDb);

0 commit comments

Comments
 (0)