Merge "Add check for WallpaperEngine compatibility" into rvc-qpr-dev am: 21d93d42d9 am: 4005242363

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12329137

Change-Id: Ied4ac9ae974a35c4aa9aa80b47f7344de8088a67
This commit is contained in:
Santiago Etchebehere
2020-08-07 18:07:36 +00:00
committed by Automerger Merge Worker

View File

@@ -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) {