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

Commit abef08c1 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 9625236 from 55940174 to tm-qpr3-release

Change-Id: Ifedff8031fa27d9b78f4d24b3dab9b46928f3eee
parents 71649df9 55940174
Loading
Loading
Loading
Loading
+45 −7
Original line number Original line Diff line number Diff line
@@ -56,6 +56,9 @@ public class GestureNavigationSettingsObserver extends ContentObserver {
        }
        }
    };
    };


    /**
     * Registers the observer for all users.
     */
    public void register() {
    public void register() {
        ContentResolver r = mContext.getContentResolver();
        ContentResolver r = mContext.getContentResolver();
        r.registerContentObserver(
        r.registerContentObserver(
@@ -73,7 +76,10 @@ public class GestureNavigationSettingsObserver extends ContentObserver {
                mOnPropertiesChangedListener);
                mOnPropertiesChangedListener);
    }
    }


    public void registerForCurrentUser() {
    /**
     * Registers the observer for the calling user.
     */
    public void registerForCallingUser() {
        ContentResolver r = mContext.getContentResolver();
        ContentResolver r = mContext.getContentResolver();
        r.registerContentObserver(
        r.registerContentObserver(
                Settings.Secure.getUriFor(Settings.Secure.BACK_GESTURE_INSET_SCALE_LEFT),
                Settings.Secure.getUriFor(Settings.Secure.BACK_GESTURE_INSET_SCALE_LEFT),
@@ -103,12 +109,46 @@ public class GestureNavigationSettingsObserver extends ContentObserver {
        }
        }
    }
    }


    /**
     * Returns the left sensitivity for the current user.  To be used in code that runs primarily
     * in one user's process.
     */
    public int getLeftSensitivity(Resources userRes) {
    public int getLeftSensitivity(Resources userRes) {
        return getSensitivity(userRes, Settings.Secure.BACK_GESTURE_INSET_SCALE_LEFT);
        final float scale = Settings.Secure.getFloatForUser(mContext.getContentResolver(),
                Settings.Secure.BACK_GESTURE_INSET_SCALE_LEFT, 1.0f, UserHandle.USER_CURRENT);
        return (int) (getUnscaledInset(userRes) * scale);
    }

    /**
     * Returns the left sensitivity for the calling user.  To be used in code that runs in a
     * per-user process.
     */
    @SuppressWarnings("NonUserGetterCalled")
    public int getLeftSensitivityForCallingUser(Resources userRes) {
        final float scale = Settings.Secure.getFloat(mContext.getContentResolver(),
                Settings.Secure.BACK_GESTURE_INSET_SCALE_LEFT, 1.0f);
        return (int) (getUnscaledInset(userRes) * scale);
    }
    }


    /**
     * Returns the right sensitivity for the current user.  To be used in code that runs primarily
     * in one user's process.
     */
    public int getRightSensitivity(Resources userRes) {
    public int getRightSensitivity(Resources userRes) {
        return getSensitivity(userRes, Settings.Secure.BACK_GESTURE_INSET_SCALE_RIGHT);
        final float scale = Settings.Secure.getFloatForUser(mContext.getContentResolver(),
                Settings.Secure.BACK_GESTURE_INSET_SCALE_RIGHT, 1.0f, UserHandle.USER_CURRENT);
        return (int) (getUnscaledInset(userRes) * scale);
    }

    /**
     * Returns the right sensitivity for the calling user.  To be used in code that runs in a
     * per-user process.
     */
    @SuppressWarnings("NonUserGetterCalled")
    public int getRightSensitivityForCallingUser(Resources userRes) {
        final float scale = Settings.Secure.getFloat(mContext.getContentResolver(),
                Settings.Secure.BACK_GESTURE_INSET_SCALE_RIGHT, 1.0f);
        return (int) (getUnscaledInset(userRes) * scale);
    }
    }


    public boolean areNavigationButtonForcedVisible() {
    public boolean areNavigationButtonForcedVisible() {
@@ -116,7 +156,7 @@ public class GestureNavigationSettingsObserver extends ContentObserver {
                Settings.Secure.USER_SETUP_COMPLETE, 0, UserHandle.USER_CURRENT) == 0;
                Settings.Secure.USER_SETUP_COMPLETE, 0, UserHandle.USER_CURRENT) == 0;
    }
    }


    private int getSensitivity(Resources userRes, String side) {
    private float getUnscaledInset(Resources userRes) {
        final DisplayMetrics dm = userRes.getDisplayMetrics();
        final DisplayMetrics dm = userRes.getDisplayMetrics();
        final float defaultInset = userRes.getDimension(
        final float defaultInset = userRes.getDimension(
                com.android.internal.R.dimen.config_backGestureInset) / dm.density;
                com.android.internal.R.dimen.config_backGestureInset) / dm.density;
@@ -127,8 +167,6 @@ public class GestureNavigationSettingsObserver extends ContentObserver {
                : defaultInset;
                : defaultInset;
        final float inset = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, backGestureInset,
        final float inset = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, backGestureInset,
                dm);
                dm);
        final float scale = Settings.Secure.getFloatForUser(
        return inset;
                mContext.getContentResolver(), side, 1.0f, UserHandle.USER_CURRENT);
        return (int) (inset * scale);
    }
    }
}
}
+0 −24
Original line number Original line Diff line number Diff line
@@ -331,30 +331,6 @@
    -->
    -->
    <dimen name="overridable_minimal_size_pip_resizable_task">48dp</dimen>
    <dimen name="overridable_minimal_size_pip_resizable_task">48dp</dimen>


    <!-- The size of the drag handle / menu shown along with a floating task. -->
    <dimen name="floating_task_menu_size">32dp</dimen>

    <!-- The size of menu items in the floating task menu. -->
    <dimen name="floating_task_menu_item_size">24dp</dimen>

    <!-- The horizontal margin of menu items in the floating task menu. -->
    <dimen name="floating_task_menu_item_padding">5dp</dimen>

    <!-- The width of visible floating view region when stashed. -->
    <dimen name="floating_task_stash_offset">32dp</dimen>

    <!-- The amount of elevation for a floating task. -->
    <dimen name="floating_task_elevation">8dp</dimen>

    <!-- The amount of padding around the bottom and top of the task. -->
    <dimen name="floating_task_vertical_padding">8dp</dimen>

    <!-- The normal size of the dismiss target. -->
    <dimen name="floating_task_dismiss_circle_size">150dp</dimen>

    <!-- The smaller size of the dismiss target (shrinks when something is in the target). -->
    <dimen name="floating_dismiss_circle_small">120dp</dimen>

    <!-- The thickness of shadows of a window that has focus in DIP. -->
    <!-- The thickness of shadows of a window that has focus in DIP. -->
    <dimen name="freeform_decor_shadow_focused_thickness">20dp</dimen>
    <dimen name="freeform_decor_shadow_focused_thickness">20dp</dimen>


+1 −1
Original line number Original line Diff line number Diff line
@@ -209,7 +209,7 @@ public class PipAnimationController {
    /**
    /**
     * Quietly cancel the animator by removing the listeners first.
     * Quietly cancel the animator by removing the listeners first.
     */
     */
    static void quietCancel(@NonNull ValueAnimator animator) {
    public static void quietCancel(@NonNull ValueAnimator animator) {
        animator.removeAllUpdateListeners();
        animator.removeAllUpdateListeners();
        animator.removeAllListeners();
        animator.removeAllListeners();
        animator.cancel();
        animator.cancel();
+6 −0
Original line number Original line Diff line number Diff line
@@ -715,6 +715,12 @@ public class PipController implements PipTransitionController.PipTransitionCallb


    private void onDisplayChanged(DisplayLayout layout, boolean saveRestoreSnapFraction) {
    private void onDisplayChanged(DisplayLayout layout, boolean saveRestoreSnapFraction) {
        if (!mPipBoundsState.getDisplayLayout().isSameGeometry(layout)) {
        if (!mPipBoundsState.getDisplayLayout().isSameGeometry(layout)) {
            PipAnimationController.PipTransitionAnimator animator =
                    mPipAnimationController.getCurrentAnimator();
            if (animator != null && animator.isRunning()) {
                // cancel any running animator, as it is using stale display layout information
                PipAnimationController.quietCancel(animator);
            }
            onDisplayChangedUncheck(layout, saveRestoreSnapFraction);
            onDisplayChangedUncheck(layout, saveRestoreSnapFraction);
        }
        }
    }
    }
+12 −2
Original line number Original line Diff line number Diff line
@@ -499,6 +499,11 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                            break;
                            break;
                        }
                        }
                    }
                    }
                } else if (mSideStage.getChildCount() != 0) {
                    // There are chances the entering app transition got canceled by performing
                    // rotation transition. Checks if there is any child task existed in split
                    // screen before fallback to cancel entering flow.
                    openingToSide = true;
                }
                }


                if (isEnteringSplit && !openingToSide) {
                if (isEnteringSplit && !openingToSide) {
@@ -515,7 +520,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                    }
                    }
                }
                }


                if (!isEnteringSplit && openingToSide) {
                if (!isEnteringSplit && apps != null) {
                    final WindowContainerTransaction evictWct = new WindowContainerTransaction();
                    final WindowContainerTransaction evictWct = new WindowContainerTransaction();
                    prepareEvictNonOpeningChildTasks(position, apps, evictWct);
                    prepareEvictNonOpeningChildTasks(position, apps, evictWct);
                    mSyncQueue.queue(evictWct);
                    mSyncQueue.queue(evictWct);
@@ -598,6 +603,11 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                            break;
                            break;
                        }
                        }
                    }
                    }
                } else if (mSideStage.getChildCount() != 0) {
                    // There are chances the entering app transition got canceled by performing
                    // rotation transition. Checks if there is any child task existed in split
                    // screen before fallback to cancel entering flow.
                    openingToSide = true;
                }
                }


                if (isEnteringSplit && !openingToSide && apps != null) {
                if (isEnteringSplit && !openingToSide && apps != null) {
@@ -624,7 +634,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                }
                }




                if (!isEnteringSplit && openingToSide) {
                if (!isEnteringSplit && apps != null) {
                    final WindowContainerTransaction evictWct = new WindowContainerTransaction();
                    final WindowContainerTransaction evictWct = new WindowContainerTransaction();
                    prepareEvictNonOpeningChildTasks(position, apps, evictWct);
                    prepareEvictNonOpeningChildTasks(position, apps, evictWct);
                    mSyncQueue.queue(evictWct);
                    mSyncQueue.queue(evictWct);
Loading