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

Commit 95f2316d authored by Yunfan Chen's avatar Yunfan Chen Committed by Automerger Merge Worker
Browse files

Merge "Introduce GesturePointerEventListener on sysUI (3/n)" into udc-qpr-dev...

Merge "Introduce GesturePointerEventListener on sysUI (3/n)" into udc-qpr-dev am: 91e1e7da am: 1b5e1458

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23421822



Change-Id: I7e0eb944dbb03ab723c11481053caccda4bb9092
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents eb944d24 1b5e1458
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -292,6 +292,7 @@
-packages/SystemUI/src/com/android/systemui/statusbar/events/SystemEventCoordinator.kt
-packages/SystemUI/src/com/android/systemui/statusbar/events/SystemEventCoordinator.kt
-packages/SystemUI/src/com/android/systemui/statusbar/events/SystemStatusAnimationScheduler.kt
-packages/SystemUI/src/com/android/systemui/statusbar/events/SystemStatusAnimationScheduler.kt
-packages/SystemUI/src/com/android/systemui/statusbar/events/SystemStatusAnimationSchedulerImpl.kt
-packages/SystemUI/src/com/android/systemui/statusbar/events/SystemStatusAnimationSchedulerImpl.kt
-packages/SystemUI/src/com/android/systemui/statusbar/gesture/GesturePointerEventDetector.kt
-packages/SystemUI/src/com/android/systemui/statusbar/gesture/GenericGestureDetector.kt
-packages/SystemUI/src/com/android/systemui/statusbar/gesture/GenericGestureDetector.kt
-packages/SystemUI/src/com/android/systemui/statusbar/gesture/SwipeUpGestureHandler.kt
-packages/SystemUI/src/com/android/systemui/statusbar/gesture/SwipeUpGestureHandler.kt
-packages/SystemUI/src/com/android/systemui/statusbar/gesture/SwipeUpGestureLogger.kt
-packages/SystemUI/src/com/android/systemui/statusbar/gesture/SwipeUpGestureLogger.kt
+7 −0
Original line number Original line Diff line number Diff line
@@ -49,6 +49,7 @@ import com.android.systemui.recents.Recents
import com.android.systemui.settings.dagger.MultiUserUtilsModule
import com.android.systemui.settings.dagger.MultiUserUtilsModule
import com.android.systemui.shortcut.ShortcutKeyDispatcher
import com.android.systemui.shortcut.ShortcutKeyDispatcher
import com.android.systemui.statusbar.ImmersiveModeConfirmation
import com.android.systemui.statusbar.ImmersiveModeConfirmation
import com.android.systemui.statusbar.gesture.GesturePointerEventListener
import com.android.systemui.statusbar.notification.InstantAppNotifier
import com.android.systemui.statusbar.notification.InstantAppNotifier
import com.android.systemui.statusbar.phone.KeyguardLiftController
import com.android.systemui.statusbar.phone.KeyguardLiftController
import com.android.systemui.statusbar.phone.LockscreenWallpaper
import com.android.systemui.statusbar.phone.LockscreenWallpaper
@@ -182,6 +183,12 @@ abstract class SystemUICoreStartableModule {
    @ClassKey(ScreenDecorations::class)
    @ClassKey(ScreenDecorations::class)
    abstract fun bindScreenDecorations(sysui: ScreenDecorations): CoreStartable
    abstract fun bindScreenDecorations(sysui: ScreenDecorations): CoreStartable


    /** Inject into GesturePointerEventHandler. */
    @Binds
    @IntoMap
    @ClassKey(GesturePointerEventListener::class)
    abstract fun bindGesturePointerEventListener(sysui: GesturePointerEventListener): CoreStartable

    /** Inject into SessionTracker.  */
    /** Inject into SessionTracker.  */
    @Binds
    @Binds
    @IntoMap
    @IntoMap
+46 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.statusbar.gesture

import android.content.Context
import android.view.InputEvent
import android.view.MotionEvent
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.settings.DisplayTracker
import javax.inject.Inject

/**
 * A class to detect when a motion event happens. To be notified when the event is detected, add a
 * callback via [addOnGestureDetectedCallback].
 */
@SysUISingleton
class GesturePointerEventDetector @Inject constructor(
        private val context: Context,
        displayTracker: DisplayTracker
) : GenericGestureDetector(
        GesturePointerEventDetector::class.simpleName!!,
        displayTracker.defaultDisplayId
) {
    override fun onInputEvent(ev: InputEvent) {
        if (ev !is MotionEvent) {
            return
        }
        // Pass all events to [gestureDetector], which will then notify [gestureListener] when a tap
        // is detected.
        onGestureDetected(ev)
    }
}
+504 −0

File added.

Preview size limit exceeded, changes collapsed.