diff options
Diffstat (limited to 'services/java/com/android/server/WallpaperManagerService.java')
-rw-r--r-- | services/java/com/android/server/WallpaperManagerService.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/services/java/com/android/server/WallpaperManagerService.java b/services/java/com/android/server/WallpaperManagerService.java index b1a6a9a..c129b97 100644 --- a/services/java/com/android/server/WallpaperManagerService.java +++ b/services/java/com/android/server/WallpaperManagerService.java @@ -49,6 +49,7 @@ import android.service.wallpaper.IWallpaperService; import android.service.wallpaper.WallpaperService; import android.util.Slog; import android.util.Xml; +import android.view.Display; import android.view.IWindowManager; import android.view.WindowManager; @@ -726,6 +727,17 @@ class WallpaperManagerService extends IWallpaperManager.Stub { mHeight = -1; mName = ""; } + + // We always want to have some reasonable width hint. + WindowManager wm = (WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE); + Display d = wm.getDefaultDisplay(); + int baseSize = d.getMaximumSizeDimension(); + if (mWidth < baseSize) { + mWidth = baseSize; + } + if (mHeight < baseSize) { + mHeight = baseSize; + } } // Called by SystemBackupAgent after files are restored to disk. |