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:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user