Keyguard sound needs to hold wake lock.

We need to hold a wakelock while playing the keyguard lock sound,
so that it actually completes before the CPU goes to sleep.

Change-Id: I144c345383afeb911ea461b2eb17b31183b6d092
This commit is contained in:
Dianne Hackborn
2011-09-21 13:34:33 -07:00
parent a80599f5be
commit e47e8520fa
2 changed files with 17 additions and 1 deletions

View File

@@ -203,7 +203,22 @@ public class Ringtone {
mUri = uri;
openMediaPlayer();
}
/** @hide */
public void setWakeMode(Context context, int mode) {
if (mAudio == null) {
try {
openMediaPlayer();
} catch (Exception ex) {
Log.e(TAG, "setWakeMode() caught ", ex);
mAudio = null;
}
}
if (mAudio != null) {
mAudio.setWakeMode(context, mode);
}
}
/**
* Plays the ringtone.
*/