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

Commit ba8ecd20 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Fix how we hide and show the nav bar."

parents 270928bd df89e65b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -415,6 +415,13 @@ public interface WindowManager extends ViewManager {
         */
        public static final int TYPE_BOOT_PROGRESS = FIRST_SYSTEM_WINDOW+21;

        /**
         * Window type: Fake window to consume touch events when the navigation
         * bar is hidden.
         * @hide
         */
        public static final int TYPE_HIDDEN_NAV_CONSUMER = FIRST_SYSTEM_WINDOW+22;

        /**
         * End of types of system windows.
         */
+41 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.graphics.Rect;
import android.graphics.RectF;
import android.os.IBinder;
import android.os.LocalPowerManager;
import android.os.Looper;
import android.view.animation.Animation;

import java.io.FileDescriptor;
@@ -314,6 +315,36 @@ public interface WindowManagerPolicy {
        public boolean showLw(boolean doAnimation);
    }

    /**
     * Representation of a "fake window" that the policy has added to the
     * window manager to consume events.
     */
    public interface FakeWindow {
        /**
         * Remove the fake window from the window manager.
         */
        void dismiss();
    }

    /**
     * Interface for calling back in to the window manager that is private
     * between it and the policy.
     */
    public interface WindowManagerFuncs {
        /**
         * Ask the window manager to re-evaluate the system UI flags.
         */
        public void reevaluateStatusBarVisibility();

        /**
         * Add a fake window to the window manager.  This window sits
         * at the top of the other windows and consumes events.
         */
        public FakeWindow addFakeWindow(Looper looper, InputHandler inputHandler,
                String name, int windowType, int layoutParamsFlags, boolean canReceiveKeys,
                boolean hasFocus, boolean touchFullscreen);
    }

    /**
     * Bit mask that is set for all enter transition.
     */
@@ -395,6 +426,7 @@ public interface WindowManagerPolicy {
     * @param powerManager 
     */
    public void init(Context context, IWindowManager windowManager,
            WindowManagerFuncs windowManagerFuncs,
            LocalPowerManager powerManager);

    /**
@@ -762,7 +794,7 @@ public interface WindowManagerPolicy {
    /**
     * A new window has been focused.
     */
    public void focusChanged(WindowState lastFocus, WindowState newFocus);
    public int focusChangedLw(WindowState lastFocus, WindowState newFocus);
    
    /**
     * Called after the screen turns off.
@@ -967,6 +999,14 @@ public interface WindowManagerPolicy {
     */
    public void setUserRotationMode(int mode, int rotation);

    /**
     * Called when a new system UI visibility is being reported, allowing
     * the policy to adjust what is actually reported.
     * @param visibility The raw visiblity reported by the status bar.
     * @return The new desired visibility.
     */
    public int adjustSystemUiVisibilityLw(int visibility);

    /**
     * Print the WindowManagerPolicy's state into the given stream.
     *
+0 −1
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ oneway interface IStatusBar
    void topAppWindowChanged(boolean menuVisible);
    void setImeWindowStatus(in IBinder token, int vis, int backDisposition);
    void setHardKeyboardStatus(boolean available, boolean enabled);
    void userActivity();
    void toggleRecentApps();
}
+0 −1
Original line number Diff line number Diff line
@@ -46,6 +46,5 @@ interface IStatusBarService
    void onNotificationClear(String pkg, String tag, int id);
    void setSystemUiVisibility(int vis);
    void setHardKeyboardEnabled(boolean enabled);
    void userActivity();
    void toggleRecentApps();
}
+1 −13
Original line number Diff line number Diff line
@@ -60,8 +60,7 @@ public class CommandQueue extends IStatusBar.Stub {
    private static final int MSG_SHOW_IME_BUTTON        = 9 << MSG_SHIFT;
    private static final int MSG_SET_HARD_KEYBOARD_STATUS = 10 << MSG_SHIFT;
    
    private static final int MSG_USER_ACTIVITY          = 11 << MSG_SHIFT;
    private static final int MSG_TOGGLE_RECENT_APPS       = 12 << MSG_SHIFT;
    private static final int MSG_TOGGLE_RECENT_APPS       = 11 << MSG_SHIFT;

    private StatusBarIconList mList;
    private Callbacks mCallbacks;
@@ -90,7 +89,6 @@ public class CommandQueue extends IStatusBar.Stub {
        public void topAppWindowChanged(boolean visible);
        public void setImeWindowStatus(IBinder token, int vis, int backDisposition);
        public void setHardKeyboardStatus(boolean available, boolean enabled);
        public void userActivity();
        public void toggleRecentApps();
    }

@@ -191,13 +189,6 @@ public class CommandQueue extends IStatusBar.Stub {
        }
    }

    public void userActivity() {
        synchronized (mList) {
            mHandler.removeMessages(MSG_USER_ACTIVITY);
            mHandler.obtainMessage(MSG_USER_ACTIVITY, 0, 0, null).sendToTarget();
        }
    }

    public void toggleRecentApps() {
        synchronized (mList) {
            mHandler.removeMessages(MSG_TOGGLE_RECENT_APPS);
@@ -271,9 +262,6 @@ public class CommandQueue extends IStatusBar.Stub {
                case MSG_SET_HARD_KEYBOARD_STATUS:
                    mCallbacks.setHardKeyboardStatus(msg.arg1 != 0, msg.arg2 != 0);
                    break;
                case MSG_USER_ACTIVITY:
                    mCallbacks.userActivity();
                    break;
                case MSG_TOGGLE_RECENT_APPS:
                    mCallbacks.toggleRecentApps();
                    break;
Loading