Using the new contract for some systemUI constants

Change-Id: I1a0351bc9b1ac5b8fe866a92c1bda93126189543
diff --git a/go/quickstep/src/com/android/quickstep/TouchInteractionService.java b/go/quickstep/src/com/android/quickstep/TouchInteractionService.java
index 2858deb..34f374c 100644
--- a/go/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/go/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -52,6 +52,7 @@
             ISystemUiProxy iSystemUiProxy = ISystemUiProxy.Stub
                     .asInterface(bundle.getBinder(KEY_EXTRA_SYSUI_PROXY));
             mRecentsModel.setSystemUiProxy(iSystemUiProxy);
+            mRecentsModel.onInitializeSystemUI(bundle);
         }
 
         @Override
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java
index a3c3ff9..aa90756 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java
@@ -89,6 +89,7 @@
                     .asInterface(bundle.getBinder(KEY_EXTRA_SYSUI_PROXY));
             runWhenUserUnlocked(() -> {
                 mRecentsModel.setSystemUiProxy(mISystemUiProxy);
+                mRecentsModel.onInitializeSystemUI(bundle);
                 mOverviewInteractionState.setSystemUiProxy(mISystemUiProxy);
             });
 
diff --git a/quickstep/src/com/android/quickstep/RecentsModel.java b/quickstep/src/com/android/quickstep/RecentsModel.java
index 81a22a1..56bc8570 100644
--- a/quickstep/src/com/android/quickstep/RecentsModel.java
+++ b/quickstep/src/com/android/quickstep/RecentsModel.java
@@ -16,12 +16,15 @@
 package com.android.quickstep;
 
 import static com.android.quickstep.TaskUtils.checkCurrentOrManagedUserId;
+import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SUPPORTS_WINDOW_CORNERS;
+import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_WINDOW_CORNER_RADIUS;
 
 import android.annotation.TargetApi;
 import android.app.ActivityManager;
 import android.content.ComponentCallbacks2;
 import android.content.Context;
 import android.os.Build;
+import android.os.Bundle;
 import android.os.HandlerThread;
 import android.os.Process;
 import android.os.RemoteException;
@@ -59,8 +62,8 @@
     private final TaskIconCache mIconCache;
     private final TaskThumbnailCache mThumbnailCache;
 
-    private float mWindowCornerRadius = -1;
-    private Boolean mSupportsRoundedCornersOnWindows;
+    private float mWindowCornerRadius = 0;
+    private boolean mSupportsRoundedCornersOnWindows;
 
     private RecentsModel(Context context) {
         mContext = context;
@@ -73,6 +76,12 @@
         ActivityManagerWrapper.getInstance().registerTaskStackListener(this);
     }
 
+    public void onInitializeSystemUI(Bundle params) {
+        mWindowCornerRadius = params.getFloat(KEY_EXTRA_WINDOW_CORNER_RADIUS, 0);
+        mSupportsRoundedCornersOnWindows =
+                params.getBoolean(KEY_EXTRA_SUPPORTS_WINDOW_CORNERS, false);
+    }
+
     public TaskIconCache getIconCache() {
         return mIconCache;
     }
@@ -182,42 +191,10 @@
     }
 
     public float getWindowCornerRadius() {
-        // The window corner radius is expressed in pixels and won't change if the
-        // display density changes. It's safe to cache the value.
-        if (mWindowCornerRadius == -1) {
-            if (mSystemUiProxy != null) {
-                try {
-                    mWindowCornerRadius = mSystemUiProxy.getWindowCornerRadius();
-                } catch (RemoteException e) {
-                    Log.w(TAG, "Connection to ISystemUIProxy was lost, ignoring window corner "
-                            + "radius");
-                    return 0;
-                }
-            } else {
-                Log.w(TAG, "ISystemUIProxy is null, ignoring window corner radius");
-                return 0;
-            }
-        }
         return mWindowCornerRadius;
     }
 
     public boolean supportsRoundedCornersOnWindows() {
-        if (mSupportsRoundedCornersOnWindows == null) {
-            if (mSystemUiProxy != null) {
-                try {
-                    mSupportsRoundedCornersOnWindows =
-                            mSystemUiProxy.supportsRoundedCornersOnWindows();
-                } catch (RemoteException e) {
-                    Log.w(TAG, "Connection to ISystemUIProxy was lost, ignoring window corner "
-                            + "radius");
-                    return false;
-                }
-            } else {
-                Log.w(TAG, "ISystemUIProxy is null, ignoring window corner radius");
-                return false;
-            }
-        }
-
         return mSupportsRoundedCornersOnWindows;
     }