How Do I determine which app is causing the “Screen Overlay Detected” error?

一曲冷凌霜 提交于 2019-12-04 10:35:53

If you can make a test view and generate a tap event on that, then for nougat and oreo versions you can use:

view.setOnTouchListener((v, event) -> {
        if ((event.getFlags() & 0x2) != 0) {
            mPresenter.onVideoViewTapped();
            return false;
        }
        return false;
    });

Here 0x2 is the value for FLAG_WINDOW_IS_PARTIALLY_OBSCURED, which is hidden as per documentation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!