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

Commit 0989a990 authored by Hiroki Sato's avatar Hiroki Sato
Browse files

Create android.view.input

This creates a new package android.view.input.
I will add more input compatibility related code here, and as a first
step this moves LetterboxScrollProcessor there.

Bug: 369865835
Test: LetterboxScrollProcessorTest, InputEventCompatProcessorTest
Flag: EXEMPT refactor
Change-Id: Ie5769e81549443b6df5cd042032430dd54906c93
parent 7e320ece
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.view;
import android.content.Context;
import android.os.Build;
import android.os.Handler;
import android.view.input.LetterboxScrollProcessor;

import com.android.window.flags.Flags;

+0 −2
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ per-file KeyEvent.java = file:/services/core/java/com/android/server/input/OWNER
per-file MotionEvent.java = file:/services/core/java/com/android/server/input/OWNERS
per-file MotionPredictor.java = file:/services/core/java/com/android/server/input/OWNERS
per-file PointerIcon.java = file:/services/core/java/com/android/server/input/OWNERS
per-file SimulatedDpad.java = file:/services/core/java/com/android/server/input/OWNERS
per-file BatchedInputEventReceiver.java = file:/services/core/java/com/android/server/input/OWNERS
per-file DragEvent.java = file:/services/core/java/com/android/server/input/OWNERS
per-file DragEvent.aidl = file:/services/core/java/com/android/server/input/OWNERS
@@ -47,7 +46,6 @@ per-file KeyCharacterMap.java = file:/services/core/java/com/android/server/inpu
per-file VelocityTracker.java = file:/services/core/java/com/android/server/input/OWNERS
per-file VerifiedInputEvent.java = file:/services/core/java/com/android/server/input/OWNERS
per-file VerifiedInputEvent.aidl = file:/services/core/java/com/android/server/input/OWNERS
per-file LetterboxScrollProcessor*.java = file:/services/core/java/com/android/server/input/OWNERS

# InputWindowHandle
per-file InputWindowHandle.java  = file:/services/core/java/com/android/server/input/OWNERS
+5 −3
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package android.view;
package android.view.input;

import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE;

@@ -22,6 +22,10 @@ import android.annotation.Nullable;
import android.content.Context;
import android.graphics.Rect;
import android.os.Handler;
import android.view.GestureDetector;
import android.view.InputDevice;
import android.view.InputEvent;
import android.view.MotionEvent;

import androidx.annotation.NonNull;

@@ -58,7 +62,6 @@ public class LetterboxScrollProcessor {
    /** IDs of events generated from this class */
    private final Set<Integer> mGeneratedEventIds = new HashSet<>();

    @VisibleForTesting(visibility = PACKAGE)
    public LetterboxScrollProcessor(@NonNull Context context, @Nullable Handler handler) {
        mContext = context;
        mScrollDetector = new GestureDetector(context, new ScrollListener(), handler);
@@ -76,7 +79,6 @@ public class LetterboxScrollProcessor {
     * if the event should be ignored. Do not keep a reference to the output as the list is reused.
     */
    @Nullable
    @VisibleForTesting(visibility = PACKAGE)
    public List<MotionEvent> processMotionEvent(@NonNull MotionEvent motionEvent) {
        if (!motionEvent.isFromSource(InputDevice.SOURCE_CLASS_POINTER)) {
            // This is a non-pointer event that doesn't correspond to any location on the screen.
+2 −0
Original line number Diff line number Diff line
# Bug component: 136048
include /INPUT_OWNERS
+3 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
 */


package android.view;
package android.view.input;

import static android.view.MotionEvent.ACTION_DOWN;
import static android.view.MotionEvent.ACTION_MOVE;
@@ -30,6 +30,8 @@ import android.graphics.Rect;
import android.os.Handler;
import android.os.Looper;
import android.platform.test.annotations.Presubmit;
import android.view.MotionEvent;
import android.view.ViewConfiguration;

import androidx.annotation.NonNull;
import androidx.test.filters.SmallTest;
Loading