11 dezembro 2025

Security is foundational to Android. We partner with you to keep the platform safe and protect user data by offering powerful security tools and features, like Credential Manager and FLAG_SECURE. Every Android release brings performance and security enhancements, and with Android 16, you can take simple, significant steps to strengthen your app’s defenses. Check out our video or continue reading to learn more about our enhanced protections for accessibility APIs.
The accessibilityDataSensitive flag allows you to explicitly mark a view or composable as containing sensitive data. When you set this flag to true on your app, you are essentially blocking potentially malicious apps from accessing your sensitive view data or performing interactions on it. Here is how it works: any app requesting accessibility permission that hasn't explicitly declared itself as a legitimate accessibility tool (isAccessibilityTool=true) is denied access to that view.
This simple but effective change helps to prevent malware from stealing information and performing unauthorized actions, all without impacting users’ experience of legitimate accessibility tools. Note: If an app is not an accessibility tool but requests accessibility permissions and sets isAccessibilityTool=true, Play will reject it and Google Play Protect will block it on user devices.
If you already use setFilterTouchesWhenObscured(true) to protect your app from tapjacking, your views are automatically treated as sensitive data for accessibility. By enhancing the setFilterTouchesWhenObscured method with accessibilityDataSensitive protections, we’re instantly giving everyone an additional layer of defense with no extra work.
We recommend that you use setFilterTouchesWhenObscured, or alternatively the accessibilityDataSensitive flag, on any screen that contains sensitive information, including login pages, payment flows, and any view displaying personal or financial data.
setFilterTouchesWhenObscured | accessibilityDataSensitive |
val composeView = LocalView.current DisposableEffect(Unit) { composeView.filterTouchesWhenObscured = true onDispose { composeView.filterTouchesWhenObscured = false } } | Use the semantics modifier to apply the sensitiveData property to a composable. BasicText { text = “Your password”, modifier = Modifier.semantics { sensitiveData = true }} |
In your XML layout, add the relevant attribute to the sensitive view.
setFilterTouchesWhenObscured | accessibilityDataSensitive |
<TextView android:filterTouchesWhenObscured="true" /> | <TextView android:accessibilityDataSensitive="true" /> |
Alternatively, you can set the property programmatically in Java or Kotlin:
setFilterTouchesWhenObscured | accessibilityDataSensitive |
myView.filterTouchesWhenObscured = true; | myView.isAccessibilityDataSensitive = true; |
myView.setFilterTouchesWhenObscured(true) | myView.setAccessibilityDataSensitive(true); |
Read more about the accessibilityDataSensitive and setFilterTouchesWhenObscured flags in the Tapjacking guide.
"We've always prioritized protecting our customers' sensitive financial data, which required us to build our own protection layer against accessibility-based malware. Revolut strongly supports the introduction of this new, official Android API, as it allows us to gradually move away from our custom code in favor of a robust, single-line platform defense."
- Vladimir Kozhevnikov, Android Engineer at Revolut