Update WallpaperManager CTS test.

New rules for suggested dimensions.

Bug:11606952
Change-Id: I4cc76f185cb613d1b35f4a64aa548b78814042cd
diff --git a/tests/tests/app/src/android/app/cts/WallpaperManagerTest.java b/tests/tests/app/src/android/app/cts/WallpaperManagerTest.java
index e27c83f..fdf3cac 100644
--- a/tests/tests/app/src/android/app/cts/WallpaperManagerTest.java
+++ b/tests/tests/app/src/android/app/cts/WallpaperManagerTest.java
@@ -18,6 +18,7 @@
 
 import android.app.WallpaperManager;
 import android.content.Context;
+import android.graphics.Point;
 import android.test.AndroidTestCase;
 import android.view.Display;
 import android.view.WindowManager;
@@ -33,30 +34,32 @@
     }
 
     public void testSuggestDesiredDimensions() {
-        int max = getMaximumSizeDimension();
-        int w = max * 3;
-        int h = max * 2;
+        Point min = getScreenSize();
+        int w = min.x * 3;
+        int h = min.y * 2;
 
-        mWallpaperManager.suggestDesiredDimensions(max / 2, max / 2);
-        assertEquals(max, mWallpaperManager.getDesiredMinimumWidth());
-        assertEquals(max, mWallpaperManager.getDesiredMinimumHeight());
+        mWallpaperManager.suggestDesiredDimensions(min.x / 2, min.y / 2);
+        assertEquals(min.x, mWallpaperManager.getDesiredMinimumWidth());
+        assertEquals(min.y, mWallpaperManager.getDesiredMinimumHeight());
 
         mWallpaperManager.suggestDesiredDimensions(w, h);
         assertEquals(w, mWallpaperManager.getDesiredMinimumWidth());
         assertEquals(h, mWallpaperManager.getDesiredMinimumHeight());
 
-        mWallpaperManager.suggestDesiredDimensions(max / 2, h);
-        assertEquals(max, mWallpaperManager.getDesiredMinimumWidth());
+        mWallpaperManager.suggestDesiredDimensions(min.x / 2, h);
+        assertEquals(min.x, mWallpaperManager.getDesiredMinimumWidth());
         assertEquals(h, mWallpaperManager.getDesiredMinimumHeight());
 
-        mWallpaperManager.suggestDesiredDimensions(w, max / 2);
+        mWallpaperManager.suggestDesiredDimensions(w, min.y / 2);
         assertEquals(w, mWallpaperManager.getDesiredMinimumWidth());
-        assertEquals(max, mWallpaperManager.getDesiredMinimumHeight());
+        assertEquals(min.y, mWallpaperManager.getDesiredMinimumHeight());
     }
 
-    private int getMaximumSizeDimension() {
+    private Point getScreenSize() {
         WindowManager wm = (WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE);
         Display d = wm.getDefaultDisplay();
-        return d.getMaximumSizeDimension();
+        Point p = new Point();
+        d.getRealSize(p);
+        return p;
     }
 }