Wednesday, 6 November 2019

How Do I Determine if a View is in a Secure Window?

Given a View, how can I determine if that View is being shown in a Window that has FLAG_SECURE?

In the simple case, where the View is shown directly in the window for an Activity, we can get that Window, then call getAttributes().flags and see if those flags include FLAG_SECURE.

However:

  • That may not be accurate if the View is being shown in some child window of the activity (the activity might have a secure window but the child window might not be secure)

  • It will not work for non-activity windows (e.g., a Service and SYSTEM_ALERT_WINDOW)

Is there a technique that can handle those edge cases as well?



from How Do I Determine if a View is in a Secure Window?

No comments:

Post a Comment