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

Commit 8a884b22 authored by Santiago Etchebehere's avatar Santiago Etchebehere
Browse files

Provide access to a mirror of WallpaperEngine SurfaceControl

Bug: 179127643
Test: manual: tested behavior of wallpaper preview in older
WallpaperPicker apk and new version

Change-Id: I3b66cbdf2198228e990fae6400d019da91bc93c9
parent 5cf8e9d2
Loading
Loading
Loading
Loading
+15 −13
Original line number Diff line number Diff line
@@ -21,27 +21,29 @@ import android.app.WallpaperColors;
import android.graphics.Rect;
import android.graphics.RectF;
import android.view.MotionEvent;
import android.view.SurfaceControl;
import android.os.Bundle;

/**
 * @hide
 */
oneway interface IWallpaperEngine {
    void setDesiredSize(int width, int height);
    void setDisplayPadding(in Rect padding);
interface IWallpaperEngine {
    oneway void setDesiredSize(int width, int height);
    oneway void setDisplayPadding(in Rect padding);
    @UnsupportedAppUsage
    void setVisibility(boolean visible);
    void setInAmbientMode(boolean inAmbientDisplay, long animationDuration);
    oneway void setVisibility(boolean visible);
    oneway void setInAmbientMode(boolean inAmbientDisplay, long animationDuration);
    @UnsupportedAppUsage
    void dispatchPointer(in MotionEvent event);
    oneway void dispatchPointer(in MotionEvent event);
    @UnsupportedAppUsage
    void dispatchWallpaperCommand(String action, int x, int y,
    oneway void dispatchWallpaperCommand(String action, int x, int y,
            int z, in Bundle extras);
    void requestWallpaperColors();
    oneway void requestWallpaperColors();
    @UnsupportedAppUsage
    void destroy();
    void setZoomOut(float scale);
    void scalePreview(in Rect positionInWindow);
    void removeLocalColorsAreas(in List<RectF> regions);
    void addLocalColorsAreas(in List<RectF> regions);
    oneway void destroy();
    oneway void setZoomOut(float scale);
    oneway void scalePreview(in Rect positionInWindow);
    oneway void removeLocalColorsAreas(in List<RectF> regions);
    oneway void addLocalColorsAreas(in List<RectF> regions);
    SurfaceControl mirrorSurfaceControl();
}
+5 −0
Original line number Diff line number Diff line
@@ -1982,6 +1982,11 @@ public abstract class WallpaperService extends Service {
            mCaller.sendMessage(msg);
        }

        @Nullable
        public SurfaceControl mirrorSurfaceControl() {
            return mEngine == null ? null : SurfaceControl.mirrorSurface(mEngine.mSurfaceControl);
        }

        private void doDetachEngine() {
            mActiveEngines.remove(mEngine);
            mEngine.detach();