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

Commit f768e865 authored by Santiago Etchebehere's avatar Santiago Etchebehere
Browse files

Add check for WallpaperEngine compatibility

Add a method in SystemUI shared library so that WallpaperPicker
can check if resizing is available.

Bug: 163087197
Test: manually verified in earlier versions of Android 11
Change-Id: I0d4b4dfc067a63a372c1b2b0502c174df5013763
parent b0c1ac5b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -26,6 +26,17 @@ public class WallpaperEngineCompat {

    private static final String TAG = "WallpaperEngineCompat";

    /**
     * Returns true if {@link IWallpaperEngine#scalePreview(Rect)} is available.
     */
    public static boolean supportsScalePreview() {
        try {
            return IWallpaperEngine.class.getMethod("scalePreview", Rect.class) != null;
        } catch (NoSuchMethodException | SecurityException e) {
            return false;
        }
    }

    private final IWallpaperEngine mWrappedEngine;

    public WallpaperEngineCompat(IWallpaperEngine wrappedEngine) {