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

Commit ea6e7f04 authored by Charles Chen's avatar Charles Chen
Browse files

Support hasNavigationBar per display(1/2)

This change is to support Auto case.
Auto may need to support displays without navigation bar by default,
because the display may be far away from driver.
Note: currently, hasNavigationBar is global since it's from config.
  In future patches, it will also check hasSystemDecorations() on
  secondary display.
TODO: We may find a way to make OEMs set hasNavigationBar() for each
  display.

Fixes: 119584629
Test: atest WmTests
Test: atest InputMethodManagerServiceTests
Test: atest SystemUiTests
Change-Id: I427f8ad1f3da644a2bf79ee5b777830378515348
parent 88dbb1b2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1435,7 +1435,7 @@ Landroid/view/IWindowManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/view/IWindowManager$Stub$Proxy;->getBaseDisplayDensity(I)I
Landroid/view/IWindowManager$Stub$Proxy;->getDockedStackSide()I
Landroid/view/IWindowManager$Stub$Proxy;->getInitialDisplayDensity(I)I
Landroid/view/IWindowManager$Stub$Proxy;->hasNavigationBar()Z
Landroid/view/IWindowManager$Stub$Proxy;->hasNavigationBar(I)Z
Landroid/view/IWindowManager$Stub$Proxy;->watchRotation(Landroid/view/IRotationWatcher;I)I
Landroid/view/IWindowManager$Stub;-><init>()V
Landroid/view/IWindowManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/view/IWindowManager;
@@ -1447,7 +1447,7 @@ Landroid/view/IWindowManager;->getBaseDisplaySize(ILandroid/graphics/Point;)V
Landroid/view/IWindowManager;->getDockedStackSide()I
Landroid/view/IWindowManager;->getInitialDisplayDensity(I)I
Landroid/view/IWindowManager;->getInitialDisplaySize(ILandroid/graphics/Point;)V
Landroid/view/IWindowManager;->hasNavigationBar()Z
Landroid/view/IWindowManager;->hasNavigationBar(I)Z
Landroid/view/IWindowManager;->isKeyguardLocked()Z
Landroid/view/IWindowManager;->isKeyguardSecure()Z
Landroid/view/IWindowManager;->isSafeModeEnabled()Z
+4 −2
Original line number Diff line number Diff line
@@ -294,9 +294,11 @@ interface IWindowManager
    void setNavBarVirtualKeyHapticFeedbackEnabled(boolean enabled);

    /**
     * Device has a software navigation bar (separate from the status bar).
     * Device has a software navigation bar (separate from the status bar) on specific display.
     *
     * @param displayId the id of display to check if there is a software navigation bar.
     */
    boolean hasNavigationBar();
    boolean hasNavigationBar(int displayId);

    /**
     * Get the position of the nav bar
+1 −1
Original line number Diff line number Diff line
@@ -393,7 +393,7 @@ public class ViewConfiguration {
                case HAS_PERMANENT_MENU_KEY_AUTODETECT: {
                    IWindowManager wm = WindowManagerGlobal.getWindowManagerService();
                    try {
                        sHasPermanentMenuKey = !wm.hasNavigationBar();
                        sHasPermanentMenuKey = !wm.hasNavigationBar(context.getDisplayId());
                        sHasPermanentMenuKeySet = true;
                    } catch (RemoteException ex) {
                        sHasPermanentMenuKey = false;
+5 −3
Original line number Diff line number Diff line
@@ -302,11 +302,13 @@ public class SystemServicesProxy {
    }

    /**
     * Returns whether there is a soft nav bar.
     * Returns whether there is a soft nav bar on specified display.
     *
     * @param displayId the id of display to check if there is a software navigation bar.
     */
    public boolean hasSoftNavigationBar() {
    public boolean hasSoftNavigationBar(int displayId) {
        try {
            return mIwm.hasNavigationBar();
            return mIwm.hasNavigationBar(displayId);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
+5 −3
Original line number Diff line number Diff line
@@ -159,11 +159,13 @@ public class WindowManagerWrapper {
    }

    /**
     * @return whether there is a soft nav bar.
     * @param displayId the id of display to check if there is a software navigation bar.
     *
     * @return whether there is a soft nav bar on specific display.
     */
    public boolean hasSoftNavigationBar() {
    public boolean hasSoftNavigationBar(int displayId) {
        try {
            return WindowManagerGlobal.getWindowManagerService().hasNavigationBar();
            return WindowManagerGlobal.getWindowManagerService().hasNavigationBar(displayId);
        } catch (RemoteException e) {
            return false;
        }
Loading