summaryrefslogtreecommitdiffstats
path: root/media/java
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-10-14 12:56:52 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-10-14 12:56:52 -0700
commit615858a8ebb12b3541fd709e6e965ac814880261 (patch)
tree988a7b2f8d5e175ffe5190ca3985982251dcfbcf /media/java
parenta1e273ae590ee08cf27baca7facfce51e598d995 (diff)
parent950e8cb40a6d826af4cc2eef9d3908c1b70486e6 (diff)
downloadframeworks_base-615858a8ebb12b3541fd709e6e965ac814880261.zip
frameworks_base-615858a8ebb12b3541fd709e6e965ac814880261.tar.gz
frameworks_base-615858a8ebb12b3541fd709e6e965ac814880261.tar.bz2
Merge "Indicate screen off condition to audio framework." into ics-mr0
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");
}
}
}