Android 通过服务覆盖视图传递触摸事件

Android 通过服务覆盖视图传递触摸事件,android,view,android-service,Android,View,Android Service,我有一个服务,它在系统屏幕上显示一些信息和一个按钮。我希望触摸事件通过服务视图,并在其下方的应用程序/屏幕上正常运行。这是我的密码 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/activity_main" android:backgroun

我有一个服务,它在系统屏幕上显示一些信息和一个按钮。我希望触摸事件通过服务视图,并在其下方的应用程序/屏幕上正常运行。这是我的密码

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/activity_main"
    android:background="@color/colorPrimary"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:clickable="false"
    >


    <RelativeLayout
        android:clickable="false"
        android:background="@color/colorPrimary"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="TEXT GOES HERE"
            android:layout_below="@+id/button"
            android:layout_margin="30dp"/>

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" 
            android:id="@+id/button"
            android:text="button"/>
    </RelativeLayout>

</RelativeLayout>
我希望触摸事件通过服务视图,并在其下方的应用程序/屏幕上正常运行


幸运的是,这已经不可能了。您所描述的是一种窃听攻击,应用程序在监视用户输入的同时仍允许该输入正常进行。出于隐私和安全原因,该网站已被屏蔽多年。

谢谢您提供的信息!
    final WindowManager.LayoutParams params;

            params = new WindowManager.LayoutParams(
                    WindowManager.LayoutParams.WRAP_CONTENT,
                    WindowManager.LayoutParams.WRAP_CONTENT,
                    WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,
                    WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
                    PixelFormat.TRANSLUCENT);
params.gravity = Gravity.BOTTOM | Gravity.LEFT;


        mWindowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
        mWindowManager.addView(myView, params);