android 7.1.1 开始 Prevent apps to overlay other apps via toast windows
16lz
2022-03-19
细节参考:https://android.googlesource.com
内容如下:
Prevent apps to overlay other apps via toast windowsIt was possible for apps to put toast type windowsthat overlay other apps which toast winodws aren'tremoved after a timeout.Now for apps targeting SDK greater than N MR1 to add atoast window one needs to have a special token. The tokenis added by the notificatoion manager service only forthe lifetime of the shown toast and is then removedincluding all windows associated with this token. Thisprevents apps to add arbitrary toast windows.Since legacy apps may rely on the ability to directlyadd toasts we mitigate by allowing these apps to stilladd such windows for unlimited duration if this app isthe currently focused one, i.e. the user interacts withit then it can overlay itself, otherwise we make surethese toast windows are removed after a timeout likea toast would be.We don't allow more that one toast window per UID beingadded at a time which prevents 1) legacy apps to put thesame toast after a timeout to go around our new policyof hiding toasts after a while; 2) modern apps to reusethe passed token to add more than one window; Note thatthe notification manager shows toasts one at a time.bug:30150688Change-Id: Icc8f8dbd060762ae1a7b1720e96c5afdb8aff3fd
更多相关文章
- Android(安卓)studio实现按钮的点击事件
- Android模仿Buttonbar
- android:注册时的协议---》方法一:弹出框
- android将后台应用置顶及moveTaskToFront的用法
- Android如何监听输入框的出现和隐藏
- 判断可用的intent和更改Drawable的透明度
- android 4.3源码编译
- org.gradle.api.GradleException: Lint found fatal errors whil
- Android基础之Android的Activity周期