Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c5ea4392 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 20812

* changes:
  Fix possible exception in default live wallpaper
parents b028f92e b4f59bff
Loading
Loading
Loading
Loading
+27 −23
Original line number Diff line number Diff line
@@ -99,7 +99,9 @@ public class ImageWallpaper extends WallpaperService {
        
        void drawFrame(boolean drawText) {
            SurfaceHolder sh = getSurfaceHolder();
            Canvas c = sh.lockCanvas();
            Canvas c = null;
            try {
                c = sh.lockCanvas();
                if (c != null) {
                    final Rect frame = sh.getSurfaceFrame();
                    mBackground.setBounds(frame);
@@ -124,7 +126,9 @@ public class ImageWallpaper extends WallpaperService {
                                frame.top + (frame.bottom-frame.top)/2, mTextPaint);
                    }
                }
            sh.unlockCanvasAndPost(c);
            } finally {
                if (c != null) sh.unlockCanvasAndPost(c);
            }
        }
    }