OSDN Git Service

RESTRICT AUTOMERGE Make toasts non-clickable
authorSterling Huber <hubers@google.com>
Thu, 7 Nov 2019 19:04:03 +0000 (11:04 -0800)
committerVasyl Gello <vasek.gello@gmail.com>
Wed, 5 Feb 2020 14:01:30 +0000 (14:01 +0000)
commit2dbe94c04016199ddc9a2569b11f96862248b1c3
treeba79cbde4d89c49ffe4475db86627bfb265ff943
parentde08dc7611564ca14259a426a6b0915b40751312
RESTRICT AUTOMERGE Make toasts non-clickable

Since enforcement was only on client-side, in Toast class, an app could
use reflection (or other means) to make the Toast clickable. This is a
security vulnerability since it allows tapjacking, that is, intercept touch
events and do stuff like steal PINs and passwords.

This CL brings the enforcement to the system by applying flag
FLAG_NOT_TOUCHABLE.

Test: atest CtsWindowManagetDeviceTestCases:ToastTest
Test: Construct app that uses reflection to remove flag FLAG_NOT_TOUCHABLE and
      log click events. Then:
      1) Observe click events are logged without this CL.
      2) Observer click events are not logged with this CL.
Bug: 128674520

(cherry picked from commit 6bf18c39d9fc727523fa3201567b836032bb2114)
Change-Id: Ica346c853dcb9a1e494f7143ba1c38d22c0003d0
services/core/java/com/android/server/policy/PhoneWindowManager.java