Merge "Improve compatibility of WallpaperCompat" into rvc-d1-dev am: 1d390491ef am: 17c9b650cb
Change-Id: I0dfb27c09a315ad110672107bd13dc2723d54baa
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
package com.android.systemui.shared.system;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.os.RemoteException;
|
||||
import android.service.wallpaper.IWallpaperEngine;
|
||||
import android.util.Log;
|
||||
|
||||
@@ -39,7 +38,7 @@ public class WallpaperEngineCompat {
|
||||
public void scalePreview(Rect scaleToRect) {
|
||||
try {
|
||||
mWrappedEngine.scalePreview(scaleToRect);
|
||||
} catch (RemoteException e) {
|
||||
} catch (Exception e) {
|
||||
Log.i(TAG, "Couldn't call scalePreview method on WallpaperEngine", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.android.systemui.shared.system;
|
||||
|
||||
import android.app.WallpaperManager;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.os.IBinder;
|
||||
|
||||
/**
|
||||
@@ -42,6 +43,9 @@ public class WallpaperManagerCompat {
|
||||
*/
|
||||
public static float getWallpaperZoomOutMaxScale(Context context) {
|
||||
return context.getResources()
|
||||
.getFloat(com.android.internal.R.dimen.config_wallpaperMaxScale);
|
||||
.getFloat(Resources.getSystem().getIdentifier(
|
||||
/* name= */ "config_wallpaperMaxScale",
|
||||
/* defType= */ "dimen",
|
||||
/* defPackage= */ "android"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user