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
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user