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

Commit 13678ee7 authored by Robert Carr's avatar Robert Carr
Browse files

Respect manually set HARDWARE_ACCELERATED flag.

When choosing what window parameters to pass on
to child windows, we need to respect the manually set
FLAG_HARDWARE_ACCELERATED from Window.setFlags() in
addition to the activity manifest value, and the value
from setWindowManager. Given that we pass the value
on to child windows from when setWindowManager is called,
I think it makes sense to pass it when setFlags is
called.

Bug: 27099358
Bug: 23036374
Change-Id: Ie018841aadd270910fe0f8bc5a5ddca3bfbee69b
parent 03046888
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@ import android.transition.Transition;
import android.transition.TransitionManager;
import android.view.accessibility.AccessibilityEvent;

import static android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;

import java.util.List;

/**
@@ -792,8 +794,9 @@ public abstract class Window {
        if (wp.packageName == null) {
            wp.packageName = mContext.getPackageName();
        }
        if (mHardwareAccelerated) {
            wp.flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
        if (mHardwareAccelerated ||
                (mWindowAttributes.flags & FLAG_HARDWARE_ACCELERATED) != 0) {
            wp.flags |= FLAG_HARDWARE_ACCELERATED;
        }
    }