This repository has been archived by the owner on Nov 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent apps to overlay other apps via toast windows
It was possible for apps to put toast type windows that overlay other apps which toast winodws aren't removed after a timeout. Now for apps targeting SDK greater than N MR1 to add a toast window one needs to have a special token. The token is added by the notificatoion manager service only for the lifetime of the shown toast and is then removed including all windows associated with this token. This prevents apps to add arbitrary toast windows. Since legacy apps may rely on the ability to directly add toasts we mitigate by allowing these apps to still add such windows for unlimited duration if this app is the currently focused one, i.e. the user interacts with it then it can overlay itself, otherwise we make sure these toast windows are removed after a timeout like a toast would be. We don't allow more that one toast window per UID being added at a time which prevents 1) legacy apps to put the same toast after a timeout to go around our new policy of hiding toasts after a while; 2) modern apps to reuse the passed token to add more than one window; Note that the notification manager shows toasts one at a time. bug:30150688 Change-Id: Ia1dae626bd9e22541be46edb072aa288eb1ae414
- Loading branch information
Showing
9 changed files
with
211 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.