I know there is a way to determine if any application overlays my application, i.e. sensory filtering (android flag: filterTouchesWhenObscured) against capturing attacks. If you want to create some policy for handling strokes, you can override the method
public boolean onFilterTouchEventForSecurity(MotionEvent event)
representation. For example, you want to show some kind of dialogue if your application is closed by another window. But you can make all these decisions if the user touches the view. I want to show a dialog when the user opens the application. Is it possible? I also tried to imitate a touch event, but I do not know where I can get MotionEvent.FLAG_WINDOW_IS_OBSCURED , and then set the movement event flags.
And the second question: is there a way to say that the application is hiding my application? For example, I know that there are many applications, such as twilight, that add a filter to your display. To do this, they use a specific permission ( android.permission.SYSTEM_ALERT_WINDOW ).
Thank.
source
share