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

Commit 40902827 authored by Bryce Lee's avatar Bryce Lee
Browse files

Set foreground priority for dream related broadcasts.

Since dreams are part of the overall UI state, it is important that
updates are delivered in a timely manner. This changelist increases
the priority of the dream state broadcasts as a foreground
broadcast.

Test: manual
Fixes: 275082798
Change-Id: I962afce95d391359aa4b0f02ca4cd124c4e77875
parent db73e54b
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.server.dreams;

import static android.app.WindowConfiguration.ACTIVITY_TYPE_DREAM;
import static android.content.Intent.FLAG_RECEIVER_FOREGROUND;

import android.app.ActivityTaskManager;
import android.app.BroadcastOptions;
@@ -69,9 +70,9 @@ final class DreamController {
    private final ActivityTaskManager mActivityTaskManager;

    private final Intent mDreamingStartedIntent = new Intent(Intent.ACTION_DREAMING_STARTED)
            .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
            .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | FLAG_RECEIVER_FOREGROUND);
    private final Intent mDreamingStoppedIntent = new Intent(Intent.ACTION_DREAMING_STOPPED)
            .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
            .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | FLAG_RECEIVER_FOREGROUND);
    private static final String DREAMING_DELIVERY_GROUP_NAMESPACE = UUID.randomUUID().toString();
    private static final String DREAMING_DELIVERY_GROUP_KEY = UUID.randomUUID().toString();
    private final Bundle mDreamingStartedStoppedOptions = createDreamingStartedStoppedOptions();