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

Commit f70239a4 authored by John Spurlock's avatar John Spurlock
Browse files

Fully block user interactions when transitioning to camera.

Bug:7464265
Change-Id: I654b3d7c455f782495946988bb2e5198ff4252ec
parent 47eb0c10
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -60,7 +60,6 @@ public class CameraWidgetFrame extends KeyguardWidgetFrame implements View.OnCli
    private boolean mActive;
    private boolean mTransitioning;
    private boolean mDown;
    private boolean mWindowFocused;

    private final Runnable mLaunchCameraRunnable = new Runnable() {
        @Override
@@ -243,7 +242,6 @@ public class CameraWidgetFrame extends KeyguardWidgetFrame implements View.OnCli
    @Override
    public void onWindowFocusChanged(boolean hasWindowFocus) {
        super.onWindowFocusChanged(hasWindowFocus);
        mWindowFocused = hasWindowFocus;
        if (DEBUG) Log.d(TAG, "onWindowFocusChanged: " + hasWindowFocus);
        if (!hasWindowFocus) {
            mTransitioning = false;
@@ -268,10 +266,6 @@ public class CameraWidgetFrame extends KeyguardWidgetFrame implements View.OnCli

    @Override
    public boolean onUserInteraction(MotionEvent event) {
        if (!mWindowFocused) {
            if (DEBUG) Log.d(TAG, "onUserInteraction eaten: !mWindowFocused");
            return true;
        }
        if (mTransitioning) {
            if (DEBUG) Log.d(TAG, "onUserInteraction eaten: mTransitioning");
            return true;
+10 −4
Original line number Diff line number Diff line
@@ -184,11 +184,17 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit

    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        KeyguardWidgetFrame currentWidgetPage = getWidgetPageAt(getCurrentPage());
        if (currentWidgetPage != null && currentWidgetPage.onUserInteraction(ev)) {
            return true;
        return captureUserInteraction(ev) || super.onTouchEvent(ev);
    }
        return super.onTouchEvent(ev);

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        return captureUserInteraction(ev) || super.onInterceptTouchEvent(ev);
    }

    private boolean captureUserInteraction(MotionEvent ev) {
        KeyguardWidgetFrame currentWidgetPage = getWidgetPageAt(getCurrentPage());
        return currentWidgetPage != null && currentWidgetPage.onUserInteraction(ev);
    }

    public void showPagingFeedback() {