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

Commit 5046a179 authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

Deprecate InputMonitor and monitorGestureInput

Gesture Monitors are deprecated in favor of spy windows, since they
offer a much greater degree of customizations for targeting certain
events, rather than listening to all events over the entire display.

Bug: 245989146
Change-Id: I58105c441ca5161cde07d5440c20824c14dbacef
Test: Presubmit
Flag: NONE docs only
parent f0237201
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1025,8 +1025,18 @@ public final class InputManager {
    /**
     * Monitor input on the specified display for gestures.
     *
     * NOTE: New usages of Gesture Monitors are strongly discouraged. Gesture Monitors are
     * deprecated, in favor of spy windows (see {@link LayoutParams#INPUT_FEATURE_SPY}).
     * The spy window should be configured specifically to receive the desired events,
     * unlike the gesture monitor which receives all events on the display.
     *
     * @hide
     * @deprecated
     * @see LayoutParams#INPUT_FEATURE_SPY
     * @see android.os.InputConfig#SPY
     * @see #pilferPointers(IBinder)
     */
    @Deprecated
    public InputMonitor monitorGestureInput(String name, int displayId) {
        return mGlobal.monitorGestureInput(name, displayId);
    }
+3 −0
Original line number Diff line number Diff line
@@ -32,8 +32,11 @@ import com.android.internal.util.DataClass;
 * registered to monitor that type of event on the targeted display.
 *
 * @hide
 * @deprecated See {@link android.hardware.input.InputManager#monitorGestureInput(String, int)}
 *             for more details.
 */
@DataClass(genToString = true)
@Deprecated
public final class InputMonitor implements Parcelable {
    private static final String TAG = "InputMonitor";

+4 −0
Original line number Diff line number Diff line
@@ -14,6 +14,9 @@
 * limitations under the License.
 */

// InputMonitor is deprecated, but we still need to test it.
@file:Suppress("DEPRECATION")

package com.android.test.input

import android.app.Activity
@@ -43,6 +46,7 @@ class UnresponsiveGestureMonitorActivity : Activity() {
    }
    private lateinit var mInputEventReceiver: InputEventReceiver
    private lateinit var mInputMonitor: InputMonitor

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val inputManager = checkNotNull(getSystemService(InputManager::class.java))