summaryrefslogtreecommitdiffstats
path: root/media/java
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-10-13 08:57:54 -0700
committerEric Laurent <elaurent@google.com>2011-10-14 11:40:24 -0700
commit950e8cb40a6d826af4cc2eef9d3908c1b70486e6 (patch)
treed9afa821e1459d33cc815923466b5300a3844aec /media/java
parente6fee18d16a86c266afef48f7705268435a99111 (diff)
downloadframeworks_base-950e8cb40a6d826af4cc2eef9d3908c1b70486e6.zip
frameworks_base-950e8cb40a6d826af4cc2eef9d3908c1b70486e6.tar.gz
frameworks_base-950e8cb40a6d826af4cc2eef9d3908c1b70486e6.tar.bz2
Indicate screen off condition to audio framework.
Add a mechanism for AudioService to notify audio framework and audio HAL that screen is turned on or off. This indication can be used by lower audio layers to trigger low power audio playback mode. Current implementaiton based on setParameters() method is experimental and will be replaced by a different interface when ready. Change-Id: Ie72ada0a8edec3d71b47681b9f51cb5bc839d45b
Diffstat (limited to 'media/java')
-rw-r--r--media/java/android/media/AudioService.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 0c5e673..e0c2b3b 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -368,6 +368,8 @@ public class AudioService extends IAudioService.Stub {
intentFilter.addAction(Intent.ACTION_USB_DGTL_HEADSET_PLUG);
intentFilter.addAction(Intent.ACTION_HDMI_AUDIO_PLUG);
intentFilter.addAction(Intent.ACTION_BOOT_COMPLETED);
+ intentFilter.addAction(Intent.ACTION_SCREEN_ON);
+ intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
context.registerReceiver(mReceiver, intentFilter);
// Register for package removal intent broadcasts for media button receiver persistence
@@ -2565,6 +2567,10 @@ public class AudioService extends IAudioService.Stub {
removeMediaButtonReceiverForPackage(packageName);
}
}
+ } else if (action.equals(Intent.ACTION_SCREEN_ON)) {
+ AudioSystem.setParameters("screen_state=on");
+ } else if (action.equals(Intent.ACTION_SCREEN_OFF)) {
+ AudioSystem.setParameters("screen_state=off");
}
}
}