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

Commit 62bf4a02 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

Force wallpaper surface to 565.

This is to maintain backward compatibility with badly programmed
GL wallpapers. Wallpapers can call SurfaceHolder.setFormat() to
request a different format.

Change-Id: Ib42b0cf6c7040d1300cad239c3acfd5c4c6cd326
parent 960b31e3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.IBinder;
@@ -178,6 +179,9 @@ public abstract class WallpaperService extends Service {
        };
        
        final BaseSurfaceHolder mSurfaceHolder = new BaseSurfaceHolder() {
            {
                mRequestedFormat = PixelFormat.RGB_565;
            }

            @Override
            public boolean onAllowLockCanvas() {
+2 −1
Original line number Diff line number Diff line
@@ -41,7 +41,8 @@ public abstract class BaseSurfaceHolder implements SurfaceHolder {

    int mRequestedWidth = -1;
    int mRequestedHeight = -1;
    int mRequestedFormat = PixelFormat.OPAQUE;
    /** @hide */
    protected int mRequestedFormat = PixelFormat.OPAQUE;
    int mRequestedType = -1;

    long mLastLockTime = 0;