diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-09-21 13:34:33 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2011-09-21 13:34:33 -0700 |
commit | e47e8520fa48bd014287eda94ea39927de73d6bc (patch) | |
tree | f2b3b93f1420ee9b7813cad49b0cfa19f1d1282e /media | |
parent | a80599f5be394edd9f3918ba03c490850a1d9e7f (diff) | |
download | frameworks_base-e47e8520fa48bd014287eda94ea39927de73d6bc.zip frameworks_base-e47e8520fa48bd014287eda94ea39927de73d6bc.tar.gz frameworks_base-e47e8520fa48bd014287eda94ea39927de73d6bc.tar.bz2 |
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
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/Ringtone.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/media/java/android/media/Ringtone.java b/media/java/android/media/Ringtone.java index 0ce3526..f2c1694 100644 --- a/media/java/android/media/Ringtone.java +++ b/media/java/android/media/Ringtone.java @@ -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. */ |