Merge "Improve compatibility of WallpaperCompat" into rvc-d1-dev am: 1d390491ef

Change-Id: I00480011b2628c57a58d36d01da82b416112eefa
This commit is contained in:
TreeHugger Robot
2020-05-13 06:55:57 +00:00
committed by Automerger Merge Worker
2 changed files with 6 additions and 3 deletions

View File

@@ -16,7 +16,6 @@
package com.android.systemui.shared.system; package com.android.systemui.shared.system;
import android.graphics.Rect; import android.graphics.Rect;
import android.os.RemoteException;
import android.service.wallpaper.IWallpaperEngine; import android.service.wallpaper.IWallpaperEngine;
import android.util.Log; import android.util.Log;
@@ -39,7 +38,7 @@ public class WallpaperEngineCompat {
public void scalePreview(Rect scaleToRect) { public void scalePreview(Rect scaleToRect) {
try { try {
mWrappedEngine.scalePreview(scaleToRect); mWrappedEngine.scalePreview(scaleToRect);
} catch (RemoteException e) { } catch (Exception e) {
Log.i(TAG, "Couldn't call scalePreview method on WallpaperEngine", e); Log.i(TAG, "Couldn't call scalePreview method on WallpaperEngine", e);
} }
} }

View File

@@ -18,6 +18,7 @@ package com.android.systemui.shared.system;
import android.app.WallpaperManager; import android.app.WallpaperManager;
import android.content.Context; import android.content.Context;
import android.content.res.Resources;
import android.os.IBinder; import android.os.IBinder;
/** /**
@@ -42,6 +43,9 @@ public class WallpaperManagerCompat {
*/ */
public static float getWallpaperZoomOutMaxScale(Context context) { public static float getWallpaperZoomOutMaxScale(Context context) {
return context.getResources() return context.getResources()
.getFloat(com.android.internal.R.dimen.config_wallpaperMaxScale); .getFloat(Resources.getSystem().getIdentifier(
/* name= */ "config_wallpaperMaxScale",
/* defType= */ "dimen",
/* defPackage= */ "android"));
} }
} }