On Android, developers can prevent apps from being taken screenshots by setting FLAG_SECURE. This has the intended side effect that it also prevents app previews from appearing in the multitasking menu, as these previews are essentially screenshots of the app in their most recently used mode. Banking apps and DRM-protected apps such as Netflix will typically make use of this protected flag, but it is the only way to prevent the preview from being displayed. Now it looks like Android 13 will only let developers disable these image previews while still allowing the user to take screenshots.
As seen by Esper, Android 13 introduces the setRecentsScreenshotEnabled API. There are a few reasons why a developer might want to use this feature. The most important thing I can imagine is when handling sensitive data that it trusts the user to decide whether it is safe to screenshot it or not. Currently, FLAG_SECURE is typically used to protect apps that display text-written content from getting their content captured, and this has the side effect of not allowing app previews to appear in the multitasking menu.
Let’s say you need to send a screenshot of a bank transfer to someone. The developer of your banking app has a choice of either setting FLAG_SECURE or using the new setRecentsScreenshotEnabled API to disable screenshots of the app displayed in the multitasking preview. If you want to send a screenshot of that upload, you can not do so while FLAG_SECURE is enabled. However, users may not want their bank’s sensitive information to appear in the multitasking menu – sensitive details such as their bank balance or recent transfers. The introduction of this API solves exactly that problem.
It’s definitely a solution to a niche problem, but I’m sure there are other situations that are similar. Developers who used FLAG_SECURE to hide app previews in the recent menu were certainly a solution that was not really intended for that use, and it’s good to see that Google allows developers to choose how to hide these app previews.