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

Commit 29c9b290 authored by Daniel Sandler's avatar Daniel Sandler Committed by Android (Google) Code Review
Browse files

Merge "Do not allow lights out mode for old apps."

parents eeb55e67 59485d74
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -654,6 +654,12 @@ public class TabletStatusBar extends StatusBar {
    // called by StatusBar
    @Override
    public void setLightsOn(boolean on) {
        // Policy note: if the frontmost activity needs the menu key, we assume it is a legacy app
        // that can't handle lights-out mode.
        if (mMenuButton.getVisibility() == View.VISIBLE
                || mMenuShadow.getVisibility() == View.VISIBLE) {
            on = true;
        }
        mHandler.removeMessages(MSG_SHOW_SHADOWS);
        mHandler.removeMessages(MSG_HIDE_SHADOWS);
        mHandler.sendEmptyMessage(on ? MSG_HIDE_SHADOWS : MSG_SHOW_SHADOWS);
@@ -664,6 +670,9 @@ public class TabletStatusBar extends StatusBar {
            Slog.d(TAG, (visible?"showing":"hiding") + " the MENU button");
        }
        mMenuButton.setVisibility(visible ? View.VISIBLE : View.GONE);

        // See above re: lights-out policy for legacy apps.
        if (visible) setLightsOn(true);
    }

    public void setIMEButtonVisible(IBinder token, boolean visible) {
+3 −3
Original line number Diff line number Diff line
@@ -1820,12 +1820,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                        final IStatusBarService sbs = mStatusBarService;
                        if (mStatusBarService != null) {
                            try {
                                if (changedFullscreen) {
                                    sbs.setActiveWindowIsFullscreen(topIsFullscreenF);
                                }
                                if (changedMenu) {
                                    sbs.setMenuKeyVisible(topNeedsMenuF);
                                }
                                if (changedFullscreen) {
                                    sbs.setActiveWindowIsFullscreen(topIsFullscreenF);
                                }
                            } catch (RemoteException e) {
                                // This should be impossible because we're in the same process.
                                mStatusBarService = null;