Merge "Add check for WallpaperEngine compatibility" into rvc-qpr-dev

This commit is contained in:
Santiago Etchebehere
2020-08-07 17:33:36 +00:00
committed by Android (Google) Code Review

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