Deprecate custom toasts
Deprecating custom toasts as discussed, the reasons are:
* We're blocking background custom toasts for security reasons
(go/toast-abuse).
* This means custom toasts are only possible if the app is in the
foreground. In the foreground the app has control over its own view
hierarchy and is capable of creating any visual elements it would
otherwise use custom toasts for.
* If we were to declare ongoing support for foreground toasts the
developer would be in a situation where they either check for
foreground status of the app before posting a custom toast or they
accept that the information they want to display may not be shown at
all. This is not great.
* There is also a desire to avoid custom toasts altogether since they
hurt UX consistency
(https://docs.google.com/presentation/d/1r5WEofZ_G3B9M65nS37uD4RqA4iV9HUmngyE6ZpBSsw/edit#slide=id.g7b69852da2_0_0).
Also added a recommendation to use Snackbars while the app is in the
foreground.
Bug: 128611929
Bug: 144754526
Test: Builds
Test: atest android.widget.cts.ToastTest
Change-Id: I4ed0bd671e308491590c28ff24087c76d0623f13
2 files changed