OSDN Git Service

DO NOT MERGE Validate wallpaper dimension while generating crop
authorAhan Wu <ahanwu@google.com>
Thu, 26 Sep 2019 11:00:26 +0000 (19:00 +0800)
committerKyriakos Ispoglou <ispo@google.com>
Fri, 8 Nov 2019 00:19:33 +0000 (16:19 -0800)
commit6630006dbdf03056a3c39cd26c64ff9bf09054ef
treea6536b035fb5b68b65d0629439a9bf9265c74eda
parentecee2ebaf6a019e257b5751337188cbb857c1630
DO NOT MERGE Validate wallpaper dimension while generating crop

If dimensions of cropped wallpaper image exceed max texture size that
GPU can support, it will cause ImageWallpaper keep crashing
because hwui crashes by invalid operation (0x502).

Bug: 120847476.
Test: Write a custom app to set a 8000x800 bitmap as wallpaper.
Test: The cropped file will be 29600x2960 and make sysui keep crashing.
Test: After applyed this cl, wallpaper will use fallback.
Test: Sysui will not keep crashing any more.
Change-Id: Ifaf2085a0bc94448e49fa2f30066f47310586236
(cherry picked from commit 160c28c36d728e932ceac5babc512cf2aa59c857)
services/core/java/com/android/server/wallpaper/GLHelper.java [new file with mode: 0644]
services/core/java/com/android/server/wallpaper/WallpaperManagerService.java