Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5cdc033b authored by Paul Colta's avatar Paul Colta
Browse files

HDMI: Increase the IntentFilter priority for HdmiControlService

Increase the IntentFilter priority to announce the HdmiControlService about the actions critical to for user experience (wake-up, turn-off). This is important to be able to send certain CEC messages on time. More details in the linked bug.

Bug: 395793347
Test: atest
Flag: EXEMPT bugfix
Change-Id: Iae6341aaf97a6af3c7fd42d692fbc99edd95f848
parent c7b882bc
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -707,13 +707,18 @@ public class HdmiControlService extends SystemService {
        publishBinderService(Context.HDMI_CONTROL_SERVICE, new BinderService());

        if (mCecController != null) {
            // Register broadcast receiver for power state change.
            IntentFilter filter = new IntentFilter();
            filter.addAction(Intent.ACTION_SCREEN_OFF);
            filter.addAction(Intent.ACTION_SCREEN_ON);
            filter.addAction(Intent.ACTION_SHUTDOWN);
            filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
            getContext().registerReceiver(mHdmiControlBroadcastReceiver, filter);
            // Register broadcast receiver for power state change with high priority.
            IntentFilter powerFilter = new IntentFilter();
            powerFilter.addAction(Intent.ACTION_SCREEN_OFF);
            powerFilter.addAction(Intent.ACTION_SCREEN_ON);
            powerFilter.addAction(Intent.ACTION_SHUTDOWN);
            powerFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
            getContext().registerReceiver(mHdmiControlBroadcastReceiver, powerFilter);

            // Register broadcast receiver for configuration change.
            IntentFilter configFilter = new IntentFilter();
            configFilter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
            getContext().registerReceiver(mHdmiControlBroadcastReceiver, configFilter);

            // Register ContentObserver to monitor the settings change.
            registerContentObserver();