Untrusted touch due to occlusion by windowName Android

1 day ago 2
ARTICLE AD BOX

I have developed an Android App which creates a layer on top of mobile screen like blue light filter. It was working fine but due to latest security changes in Android, this feature is not working in some versions of Android.

The Error Im getting is :

Untrusted touch due to occlusion by windowName:Dim Layer for - Display 0 name="Built-in Screen"#44684/1000 Dropping untrusted touch event due to windowName:Dim Layer for - Display 0 name="Built-in Screen"#44764/1000

I have been trying to fix this issue since 1 week, but couldnt find proper solution.

Can any Angel help me on this.

params = new WindowManager.LayoutParams( WindowManager.LayoutParams.MATCH_PARENT, HEIGHT, Build.VERSION.SDK_INT < Build.VERSION_CODES.O ? WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY : WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE| WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_DIM_BEHIND, PixelFormat.TRANSLUCENT);

As per my google search, it suggested that do not use

WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE

But if i dont use that, im not able to touch the underling UI elements.

enter image description here

So when i touch the screen, it shows the above toast

Read Entire Article