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

Commit f4600922 authored by Justin Koh's avatar Justin Koh Committed by Android Git Automerger
Browse files

am 9abf0b90: am 60158445: Merge "Make global action key timeout configurable." into klp-modular-dev

* commit '9abf0b90':
  Make global action key timeout configurable.
parents 698a7ab3 9abf0b90
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -30844,10 +30844,11 @@ package android.view {
  public class ViewConfiguration {
  public class ViewConfiguration {
    ctor public deprecated ViewConfiguration();
    ctor public deprecated ViewConfiguration();
    method public static android.view.ViewConfiguration get(android.content.Context);
    method public static android.view.ViewConfiguration get(android.content.Context);
    method public long getDeviceGlobalActionKeyTimeout();
    method public static int getDoubleTapTimeout();
    method public static int getDoubleTapTimeout();
    method public static deprecated int getEdgeSlop();
    method public static deprecated int getEdgeSlop();
    method public static deprecated int getFadingEdgeLength();
    method public static deprecated int getFadingEdgeLength();
    method public static long getGlobalActionKeyTimeout();
    method public static deprecated long getGlobalActionKeyTimeout();
    method public static int getJumpTapTimeout();
    method public static int getJumpTapTimeout();
    method public static int getKeyRepeatDelay();
    method public static int getKeyRepeatDelay();
    method public static int getKeyRepeatTimeout();
    method public static int getKeyRepeatTimeout();
+16 −0
Original line number Original line Diff line number Diff line
@@ -234,6 +234,7 @@ public class ViewConfiguration {
    private final int mOverscrollDistance;
    private final int mOverscrollDistance;
    private final int mOverflingDistance;
    private final int mOverflingDistance;
    private final boolean mFadingMarqueeEnabled;
    private final boolean mFadingMarqueeEnabled;
    private final long mGlobalActionsKeyTimeout;


    private boolean sHasPermanentMenuKey;
    private boolean sHasPermanentMenuKey;
    private boolean sHasPermanentMenuKeySet;
    private boolean sHasPermanentMenuKeySet;
@@ -261,6 +262,7 @@ public class ViewConfiguration {
        mOverscrollDistance = OVERSCROLL_DISTANCE;
        mOverscrollDistance = OVERSCROLL_DISTANCE;
        mOverflingDistance = OVERFLING_DISTANCE;
        mOverflingDistance = OVERFLING_DISTANCE;
        mFadingMarqueeEnabled = true;
        mFadingMarqueeEnabled = true;
        mGlobalActionsKeyTimeout = GLOBAL_ACTIONS_KEY_TIMEOUT;
    }
    }


    /**
    /**
@@ -342,6 +344,8 @@ public class ViewConfiguration {
                com.android.internal.R.dimen.config_viewMinFlingVelocity);
                com.android.internal.R.dimen.config_viewMinFlingVelocity);
        mMaximumFlingVelocity = res.getDimensionPixelSize(
        mMaximumFlingVelocity = res.getDimensionPixelSize(
                com.android.internal.R.dimen.config_viewMaxFlingVelocity);
                com.android.internal.R.dimen.config_viewMaxFlingVelocity);
        mGlobalActionsKeyTimeout = res.getInteger(
                com.android.internal.R.integer.config_globalActionsKeyTimeout);
    }
    }


    /**
    /**
@@ -698,11 +702,23 @@ public class ViewConfiguration {
     *
     *
     * @return how long a user needs to press the relevant key to bring up
     * @return how long a user needs to press the relevant key to bring up
     *   the global actions dialog.
     *   the global actions dialog.
     * @deprecated use getDeviceGlobalActionKeyTimeout
     */
     */
    public static long getGlobalActionKeyTimeout() {
    public static long getGlobalActionKeyTimeout() {
        return GLOBAL_ACTIONS_KEY_TIMEOUT;
        return GLOBAL_ACTIONS_KEY_TIMEOUT;
    }
    }


    /**
     * The amount of time a user needs to press the relevant key to bring up
     * the global actions dialog.
     *
     * @return how long a user needs to press the relevant key to bring up
     *   the global actions dialog.
     */
    public long getDeviceGlobalActionKeyTimeout() {
        return mGlobalActionsKeyTimeout;
    }

    /**
    /**
     * The amount of friction applied to scrolls and flings.
     * The amount of friction applied to scrolls and flings.
     *
     *
+3 −0
Original line number Original line Diff line number Diff line
@@ -1212,6 +1212,9 @@
    <!-- Maximum velocity to initiate a fling, as measured in dips per second. -->
    <!-- Maximum velocity to initiate a fling, as measured in dips per second. -->
    <dimen name="config_viewMaxFlingVelocity">8000dp</dimen>
    <dimen name="config_viewMaxFlingVelocity">8000dp</dimen>


    <!-- Amount of time in ms the user needs to press the relevant key to bring up the global actions dialog -->
    <integer name="config_globalActionsKeyTimeout">500</integer>

    <!-- Maximum number of grid columns permitted in the ResolverActivity
    <!-- Maximum number of grid columns permitted in the ResolverActivity
         used for picking activities to handle an intent. -->
         used for picking activities to handle an intent. -->
    <integer name="config_maxResolverActivityColumns">2</integer>
    <integer name="config_maxResolverActivityColumns">2</integer>
+1 −0
Original line number Original line Diff line number Diff line
@@ -1649,6 +1649,7 @@
  <java-symbol type="id" name="resolver_list" />
  <java-symbol type="id" name="resolver_list" />
  <java-symbol type="id" name="button_once" />
  <java-symbol type="id" name="button_once" />
  <java-symbol type="id" name="button_always" />
  <java-symbol type="id" name="button_always" />
  <java-symbol type="integer" name="config_globalActionsKeyTimeout" />
  <java-symbol type="integer" name="config_maxResolverActivityColumns" />
  <java-symbol type="integer" name="config_maxResolverActivityColumns" />
  <java-symbol type="array" name="config_notificationScorers" />
  <java-symbol type="array" name="config_notificationScorers" />


+4 −3
Original line number Original line Diff line number Diff line
@@ -667,7 +667,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    private void interceptPowerKeyDown(boolean handled) {
    private void interceptPowerKeyDown(boolean handled) {
        mPowerKeyHandled = handled;
        mPowerKeyHandled = handled;
        if (!handled) {
        if (!handled) {
            mHandler.postDelayed(mPowerLongPress, ViewConfiguration.getGlobalActionKeyTimeout());
            mHandler.postDelayed(mPowerLongPress,
                    ViewConfiguration.get(mContext).getDeviceGlobalActionKeyTimeout());
        }
        }
    }
    }


@@ -706,9 +707,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        if (mKeyguardDelegate.isShowing()) {
        if (mKeyguardDelegate.isShowing()) {
            // Double the time it takes to take a screenshot from the keyguard
            // Double the time it takes to take a screenshot from the keyguard
            return (long) (KEYGUARD_SCREENSHOT_CHORD_DELAY_MULTIPLIER *
            return (long) (KEYGUARD_SCREENSHOT_CHORD_DELAY_MULTIPLIER *
                    ViewConfiguration.getGlobalActionKeyTimeout());
                    ViewConfiguration.get(mContext).getDeviceGlobalActionKeyTimeout());
        }
        }
        return ViewConfiguration.getGlobalActionKeyTimeout();
        return ViewConfiguration.get(mContext).getDeviceGlobalActionKeyTimeout();
    }
    }


    private void cancelPendingScreenshotChordAction() {
    private void cancelPendingScreenshotChordAction() {