Skip to content

Commit

Permalink
ThemeService: crop Keyguard wallpaper to display size
Browse files Browse the repository at this point in the history
Change-Id: I74d29981e7ae254bd71cc4a5f0023b9e49d033e1
Signed-off-by: Roman Birg <[email protected]>
(cherry picked from commit 110d60b)
  • Loading branch information
romanbb committed Jan 22, 2015
1 parent 9f393f5 commit d251c88
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/java/com/android/internal/util/cm/ImageUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import android.provider.ThemesContract.ThemesColumns;
import android.text.TextUtils;
import android.util.Log;
import android.view.WindowManager;
import android.webkit.URLUtil;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
Expand Down Expand Up @@ -159,8 +160,12 @@ public static InputStream getCroppedKeyguardStream(String pkgName, Context conte
return null;
}
WallpaperManager wm = WallpaperManager.getInstance(context);
int outWidth = wm.getDesiredMinimumWidth();
int outHeight = wm.getDesiredMinimumHeight();
WindowManager service = (WindowManager) context.getSystemService(
Context.WINDOW_SERVICE);
Point size = new Point();
service.getDefaultDisplay().getSize(size);
int outWidth = size.x;
int outHeight = size.y;
stream = getOriginalKeyguardStream(pkgName, context);
if (stream == null) {
return null;
Expand Down

0 comments on commit d251c88

Please sign in to comment.