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

Commit c77edee8 authored by Luca Zuccarini's avatar Luca Zuccarini
Browse files

Remove elevation from SystemUIDialog.

Elevation is now unused and creates issues due to a weird
interaction with Window Manager. The proper fix would be in Window
Manager, but this is a band-aid on our end to avoid issues.

Bug: 404508609
Flag: com.android.systemui.spatial_model_app_pushback
Test: manually tested that the flicker is gone when launching from dialogs
Change-Id: Ie45efff9d440070dff15ed648ca89b0a212ba2c8
parent c912f0ab
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.systemui.statusbar.phone;

import static com.android.systemui.Flags.spatialModelAppPushback;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.BroadcastReceiver;
@@ -291,6 +293,14 @@ public class SystemUIDialog extends AlertDialog implements ViewRootImpl.ConfigCh
                /* backAnimationSpec= */mDelegate.getBackAnimationSpec(
                        () -> targetView.getResources().getDisplayMetrics())
        );

        if (spatialModelAppPushback()) {
            // Elevation doesn't seem to be useful anymore (there are no more shadows below
            // dialogs), and it creates a weird flickering behavior due to some obscure Window
            // Manager treatment. See b/404508609#comment3 for more details.
            // Note: can be moved to styles.xml once the flag is fully rolled out.
            getWindow().setElevation(0);
        }
    }

    private void updateWindowSize() {