OSDN Git Service

DO NOT MERGE Validate wallpaper dimension while generating crop
authorAhan Wu <ahanwu@google.com>
Thu, 26 Sep 2019 10:29:59 +0000 (18:29 +0800)
committerAhan Wu <ahanwu@google.com>
Wed, 2 Oct 2019 03:02:03 +0000 (11:02 +0800)
commitf1e1f4f04d0165ed065637a4ba556583a7c79ef0
tree197a1c705ad2583eaefe0a05a18dc3e6d197b0cf
parent604d91d71353640c585fc84c683f544dd2997815
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: I8ed5931298c652a2230858cf62df3f6fcd345c5a
services/core/java/com/android/server/wallpaper/GLHelper.java [new file with mode: 0644]
services/core/java/com/android/server/wallpaper/WallpaperManagerService.java