File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments