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

Commit 9252dbd3 authored by Daniel Sandler's avatar Daniel Sandler
Browse files

Add fullscreen to Dream.lightsOut().

Also don't go into lightsOut() by default in
onAttachedToWindow(), in case some dream doesn't want to do
that.

We should probably make this even more flexible, but
this is a start.

Change-Id: I606b42a288259902e89d59595ad60548a89866da
parent 69509926
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -172,11 +172,6 @@ public class Dream extends Service implements Window.Callback {

    @Override
    public void onAttachedToWindow() {
        mWindow.addFlags(
                WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
                | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
        );
        lightsOut();
    }

    @Override
@@ -306,7 +301,8 @@ public class Dream extends Service implements Window.Callback {
        // turn the lights down low
        final View v = mWindow.getDecorView();
        if (v != null) {
            v.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
            v.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE 
                                  | View.SYSTEM_UI_FLAG_FULLSCREEN);
        }
    }