• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

frameworks/base


Commit MetaInfo

修订版71be05dc5d419aacd0d42484f7b6d2f44907e818 (tree)
时间2020-06-05 03:25:48
作者Ahan Wu <ahanwu@goog...>
CommiterAnis Assi

Log Message

DO NOT MERGE Prevent ImageWallpaper from keeping crashing

GLUtil.texImage2D may throw exception that indicates bad image format.
We should catch this exception, otherwise, systemui may keep crashing.

Bug: 156087409
Test: Set a 16-bit rgb image as wallpaper
Test: Systemui shouldn't keep crashing
Change-Id: I6c9715c049b7848ecd5559ab76612a98dcd4ee6f
(cherry picked from commit a3bff94e184590351fd95f630e8b8313d1d2053b)

更改概述

差异

--- a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
+++ b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
@@ -603,7 +603,16 @@ public class ImageWallpaper extends WallpaperService {
603603
604604 final FloatBuffer triangleVertices = createMesh(left, top, right, bottom);
605605
606- final int texture = loadTexture(mBackground);
606+ int texture = 0;
607+ try {
608+ texture = loadTexture(mBackground);
609+ } catch (IllegalArgumentException e) {
610+ mEgl.eglMakeCurrent(mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
611+ mEgl.eglDestroySurface(mEglDisplay, mEglSurface);
612+ mEgl.eglDestroyContext(mEglDisplay, mEglContext);
613+ mEgl.eglTerminate(mEglDisplay);
614+ return false;
615+ }
607616 final int program = buildProgram(sSimpleVS, sSimpleFS);
608617
609618 final int attribPosition = glGetAttribLocation(program, "position");