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

Commit 1541d21e authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4739962 from f16521df to pi-release

Change-Id: Idea7d32447f6e32dd9620dbf66375f77a130e431
parents 00ae95b1 f16521df
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -73,17 +73,24 @@ public final class ContentLock {
        }
    }

    /**
     * Returns true if locked.
     */
    synchronized boolean isLocked() {
        return mLocks > 0;
    }

    /**
     * Allows other selection code to perform a precondition check asserting the state is locked.
     */
    final void checkLocked() {
        checkState(mLocks > 0);
        checkState(isLocked());
    }

    /**
     * Allows other selection code to perform a precondition check asserting the state is unlocked.
     */
    final void checkUnlocked() {
        checkState(mLocks == 0);
        checkState(!isLocked());
    }
}
+7 −1
Original line number Diff line number Diff line
@@ -78,7 +78,13 @@ public final class GestureSelectionHelper extends ScrollHost implements OnItemTo
     */
    public void start() {
        checkState(!mStarted);
        checkState(mLastStartedItemPos > -1);
        // See: b/70518185. It appears start() is being called via onLongPress
        // even though we never received an intial handleInterceptedDownEvent
        // where we would usually initialize mLastStartedItemPos.
        if (mLastStartedItemPos < 0){
          Log.w(TAG, "Illegal state. Can't start without valid mLastStartedItemPos.");
          return;
        }

        // Partner code in MotionInputHandler ensures items
        // are selected and range established prior to
+3 −4
Original line number Diff line number Diff line
@@ -80,11 +80,10 @@ public class GestureSelectionHelperTest {

    @Test
    public void testNoStartOnIllegalPosition() {
        mView.mNextPosition = -1;
        mHelper.onInterceptTouchEvent(null, DOWN);
        try {
        mHelper.start();
            fail("Should have thrown.");
        } catch (Exception expected) {}
        assertFalse(mLock.isLocked());
    }

    @Test