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

Commit 516f953a authored by Alan Viverette's avatar Alan Viverette
Browse files

resolved conflicts for merge of e4ccb864 to master

Change-Id: I50c41c712c4eb4f68b22777efb2e5d5370536b22
parents f90299df e4ccb864
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -274,4 +274,11 @@ interface IWindowManager
     * @return The magnification spec if such or null.
     */
    MagnificationSpec getCompatibleMagnificationSpecForWindow(in IBinder windowToken);

    /**
     * Sets the current touch exploration state.
     *
     * @param enabled Whether touch exploration is enabled.
     */
    void setTouchExplorationEnabled(boolean enabled);
}
+7 −0
Original line number Diff line number Diff line
@@ -1198,4 +1198,11 @@ public interface WindowManagerPolicy {
     * @return True if the window is a top level one.
     */
    public boolean isTopLevelWindow(int windowType);

    /**
     * Sets the current touch exploration state.
     *
     * @param enabled Whether touch exploration is enabled.
     */
    public void setTouchExplorationEnabled(boolean enabled);
}
+31 −12
Original line number Diff line number Diff line
@@ -296,6 +296,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    boolean mOrientationSensorEnabled = false;
    int mCurrentAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
    boolean mHasSoftInput = false;
    boolean mTouchExplorationEnabled = false;

    int mPointerLocationMode = 0; // guarded by mLock

@@ -1078,14 +1079,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            mHasNavigationBar = true;
        }

        if (mHasNavigationBar) {
            // The navigation bar is at the right in landscape; it seems always
            // useful to hide it for showing a video.
            mCanHideNavigationBar = true;
        } else {
            mCanHideNavigationBar = false;
        }

        // For demo purposes, allow the rotation of the HDMI display to be controlled.
        // By default, HDMI locks rotation to landscape.
        if ("portrait".equals(SystemProperties.get("persist.demo.hdmirotation"))) {
@@ -1105,6 +1098,14 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                !"true".equals(SystemProperties.get("config.override_forced_orient"));
    }

    /**
     * @return whether the navigation bar can be hidden, e.g. the device has a
     *         navigation bar and touch exploration is not enabled
     */
    private boolean canHideNavigationBar() {
        return mHasNavigationBar && !mTouchExplorationEnabled;
    }

    @Override
    public boolean isDefaultOrientationForced() {
        return mForceDefaultOrientation;
@@ -2585,7 +2586,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        if ((fl & (FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_INSET_DECOR))
                == (FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_INSET_DECOR)) {
            int availRight, availBottom;
            if (mCanHideNavigationBar &&
            if (canHideNavigationBar() &&
                    (systemUiVisibility & View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION) != 0) {
                availRight = mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
                availBottom = mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
@@ -2702,6 +2703,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            boolean navTranslucent = (sysui & View.NAVIGATION_BAR_TRANSLUCENT) != 0;
            boolean transientAllowed = (sysui & View.SYSTEM_UI_FLAG_IMMERSIVE) != 0;
            navTranslucent &= !transientAllowed;  // transient trumps translucent
            navTranslucent &= isTranslucentNavigationAllowed();

            // When the navigation bar isn't visible, we put up a fake
            // input window to catch all touch events.  This way we can
@@ -2722,7 +2724,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            // For purposes of positioning and showing the nav bar, if we have
            // decided that it can't be hidden (because of the screen aspect ratio),
            // then take that into account.
            navVisible |= !mCanHideNavigationBar;
            navVisible |= !canHideNavigationBar();

            boolean updateSysUiVisibility = false;
            if (mNavigationBar != null) {
@@ -3068,7 +3070,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                        pf.right = df.right = of.right = mOverscanScreenLeft + mOverscanScreenWidth;
                        pf.bottom = df.bottom = of.bottom = mOverscanScreenTop
                                + mOverscanScreenHeight;
                    } else if (mCanHideNavigationBar
                    } else if (canHideNavigationBar()
                            && (sysUiFl & View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION) != 0
                            && attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW
                            && attrs.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW) {
@@ -3206,7 +3208,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                            = mOverscanScreenLeft + mOverscanScreenWidth;
                    pf.bottom = df.bottom = of.bottom = cf.bottom
                            = mOverscanScreenTop + mOverscanScreenHeight;
                } else if (mCanHideNavigationBar
                } else if (canHideNavigationBar()
                        && (sysUiFl & View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION) != 0
                        && (attrs.type == TYPE_TOAST
                            || (attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW
@@ -5096,6 +5098,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            vis = (vis & ~flags) | (oldVis & flags);
        }

        if (!isTranslucentNavigationAllowed()) {
            vis &= ~View.NAVIGATION_BAR_TRANSLUCENT;
        }

        // update status bar
        boolean transientAllowed =
                (vis & View.SYSTEM_UI_FLAG_IMMERSIVE) != 0;
@@ -5146,6 +5152,14 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                && (vis & View.SYSTEM_UI_FLAG_IMMERSIVE) != 0;
    }

    /**
     * @return whether the navigation bar can be made translucent, e.g. touch
     *         exploration is not enabled
     */
    private boolean isTranslucentNavigationAllowed() {
        return !mTouchExplorationEnabled;
    }

    // Use this instead of checking config_showNavigationBar so that it can be consistently
    // overridden by qemu.hw.mainkeys in the emulator.
    @Override
@@ -5188,6 +5202,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        return true;
    }

    @Override
    public void setTouchExplorationEnabled(boolean enabled) {
        mTouchExplorationEnabled = enabled;
    }

    @Override
    public boolean isTopLevelWindow(int windowType) {
        if (windowType >= WindowManager.LayoutParams.FIRST_SUB_WINDOW
+5 −0
Original line number Diff line number Diff line
@@ -1586,6 +1586,11 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
                    Settings.Secure.TOUCH_EXPLORATION_ENABLED, enabled ? 1 : 0,
                    userState.mUserId);
        }
        try {
            mWindowManagerService.setTouchExplorationEnabled(enabled);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }

    private boolean canRequestAndRequestsTouchExplorationLocked(Service service) {
+5 −0
Original line number Diff line number Diff line
@@ -5206,6 +5206,11 @@ public class WindowManagerService extends IWindowManager.Stub
        mInputManager.setInputFilter(filter);
    }

    @Override
    public void setTouchExplorationEnabled(boolean enabled) {
        mPolicy.setTouchExplorationEnabled(enabled);
    }

    public void setCurrentUser(final int newUserId) {
        synchronized (mWindowMap) {
            int oldUserId = mCurrentUserId;