Skip to content

Commit e04783c

Browse files
Eric LaurentAndroid Git Automerger
authored andcommitted
am 615858a: Merge "Indicate screen off condition to audio framework." into ics-mr0
* commit '615858a8ebb12b3541fd709e6e965ac814880261': Indicate screen off condition to audio framework.
2 parents 93c299d + 615858a commit e04783c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

media/java/android/media/AudioService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ public AudioService(Context context) {
368368
intentFilter.addAction(Intent.ACTION_USB_DGTL_HEADSET_PLUG);
369369
intentFilter.addAction(Intent.ACTION_HDMI_AUDIO_PLUG);
370370
intentFilter.addAction(Intent.ACTION_BOOT_COMPLETED);
371+
intentFilter.addAction(Intent.ACTION_SCREEN_ON);
372+
intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
371373
context.registerReceiver(mReceiver, intentFilter);
372374

373375
// Register for package removal intent broadcasts for media button receiver persistence
@@ -2565,6 +2567,10 @@ public void onReceive(Context context, Intent intent) {
25652567
removeMediaButtonReceiverForPackage(packageName);
25662568
}
25672569
}
2570+
} else if (action.equals(Intent.ACTION_SCREEN_ON)) {
2571+
AudioSystem.setParameters("screen_state=on");
2572+
} else if (action.equals(Intent.ACTION_SCREEN_OFF)) {
2573+
AudioSystem.setParameters("screen_state=off");
25682574
}
25692575
}
25702576
}

0 commit comments

Comments
 (0)