OSDN Git Service

Validate wallpaper dimension while generating crop
authorAhan Wu <ahanwu@google.com>
Thu, 3 Oct 2019 04:36:59 +0000 (12:36 +0800)
committerAhan Wu <ahanwu@google.com>
Sat, 5 Oct 2019 00:27:57 +0000 (08:27 +0800)
commit32c6a7c691b0d91085c1ed13fe6f1c473c94b4c8
tree708c7d74c1e14f53b02b54e9089f5c57e6fcadde
parente31854028e94afea9c4e873a8bc01097c12ecbd3
Validate wallpaper dimension while generating crop

If dimensions of cropped wallpaper exceed max texture size that GPU can
support, it will cause sysui keep crashing because it can not initialize
egl with an appropriate surface.

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: Icdc6292191d1e966c52640f4c1a5a154dfba45d3
services/core/java/com/android/server/wallpaper/GLHelper.java [new file with mode: 0644]
services/core/java/com/android/server/wallpaper/WallpaperManagerService.java