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

Commit c39f0095 authored by Sashidhar Ganiga's avatar Sashidhar Ganiga
Browse files

framework/base: Fix touch failure during video and incoming call.

Issue: Play a video File. Make a call to the test device , we
       see an incoming call notification. When we try to dismiss
       or accept call by touch the buttons of notification the
       touch is not accepted first time, but responds second time.

Fix: The fake window is created when video playing which is
     taking the input events. We must not create this if a HeadsUp
     notification is displayed.

Change-Id: Ib02b2065ff328aa9609f5b5a243274264b826e2f
CRs-Fixed: 720042
parent 628bc01b
Loading
Loading
Loading
Loading
+17 −2
Original line number Original line Diff line number Diff line
@@ -278,6 +278,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {


    boolean mSafeMode;
    boolean mSafeMode;
    WindowState mStatusBar = null;
    WindowState mStatusBar = null;
    WindowState mHeadsUp = null;
    int mStatusBarHeight;
    int mStatusBarHeight;
    WindowState mNavigationBar = null;
    WindowState mNavigationBar = null;
    boolean mHasNavigationBar = false;
    boolean mHasNavigationBar = false;
@@ -1996,6 +1997,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                mContext.enforceCallingOrSelfPermission(
                mContext.enforceCallingOrSelfPermission(
                        android.Manifest.permission.STATUS_BAR_SERVICE,
                        android.Manifest.permission.STATUS_BAR_SERVICE,
                        "PhoneWindowManager");
                        "PhoneWindowManager");
                if (mHeadsUp != null) {
                    if (mHeadsUp.isAlive()) {
                        return WindowManagerGlobal.ADD_MULTIPLE_SINGLETON;
                    }
                }
                mHeadsUp = win;
                if (DEBUG) Slog.i(TAG, "HeadsUp Notification: " + mHeadsUp);
                break;
                break;
            case TYPE_STATUS_BAR_SUB_PANEL:
            case TYPE_STATUS_BAR_SUB_PANEL:
                mContext.enforceCallingOrSelfPermission(
                mContext.enforceCallingOrSelfPermission(
@@ -2026,6 +2034,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        } if (mNavigationBar == win) {
        } if (mNavigationBar == win) {
            mNavigationBar = null;
            mNavigationBar = null;
            mNavigationBarController.setWindow(null);
            mNavigationBarController.setWindow(null);
        } if (mHeadsUp == win) {
            if (DEBUG) Slog.i(TAG, "Removing HeadsUp notfication: " + mHeadsUp);
            mHeadsUp = null;
        }
        }
    }
    }


@@ -3066,12 +3077,16 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            if (!isKeyguardShowing) {
            if (!isKeyguardShowing) {
                navTranslucent &= areTranslucentBarsAllowed();
                navTranslucent &= areTranslucentBarsAllowed();
            }
            }

            boolean headsUpVisible = false; // needed for the case when HeadsUpNotification is displayed.
            if(mHeadsUp != null )
                headsUpVisible = mHeadsUp.isVisibleLw();
            // When the navigation bar isn't visible, we put up a fake
            // When the navigation bar isn't visible, we put up a fake
            // input window to catch all touch events.  This way we can
            // input window to catch all touch events.  This way we can
            // detect when the user presses anywhere to bring back the nav
            // detect when the user presses anywhere to bring back the nav
            // bar and ensure the application doesn't see the event.
            // bar and ensure the application doesn't see the event.
            if (navVisible || navAllowedHidden) {
            // Fake window should not be displayed when HeadsUpNotificationView
            // in the form of HighPriority notifications are displayed
            if (navVisible || navAllowedHidden || headsUpVisible) {
                if (mHideNavFakeWindow != null) {
                if (mHideNavFakeWindow != null) {
                    mHideNavFakeWindow.dismiss();
                    mHideNavFakeWindow.dismiss();
                    mHideNavFakeWindow = null;
                    mHideNavFakeWindow = null;