Limited number of Recents

Change-Id: Ie47080c85b5652b1b5a75d1c6efd83ecb69db525
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 87c9efc2..e76e492 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -75,8 +75,6 @@
     private static String TAG = "ActivityManager";
     private static boolean localLOGV = false;
 
-    private static int gMaxRecentTasks = -1;
-
     private final Context mContext;
     private final Handler mHandler;
 
@@ -349,6 +347,15 @@
      */
     public static final int LOCK_TASK_MODE_PINNED = 2;
 
+    /** @hide The maximum number of recents entries that we will maintain and show. */
+    public static final int RECENTS_MAX_TASKS = 18;
+
+    /** @hide The maximum limit on the number of recents that an app can make. */
+    public static final int RECENTS_APP_LIMIT_MAX = 6;
+
+    /** @hide The default limit on the number of recents that an app can make. */
+    public static final int RECENTS_APP_LIMIT_DEFAULT = 4;
+
     Point mAppTaskThumbnailSize;
 
     /*package*/ ActivityManager(Context context, Handler handler) {
@@ -534,10 +541,7 @@
      * @hide
      */
     static public int getMaxRecentTasksStatic() {
-        if (gMaxRecentTasks < 0) {
-            return gMaxRecentTasks = isLowRamDeviceStatic() ? 50 : 100;
-        }
-        return gMaxRecentTasks;
+        return RECENTS_MAX_TASKS;
     }
 
     /**
@@ -545,7 +549,7 @@
      * @hide
      */
     static public int getDefaultAppRecentsLimitStatic() {
-        return getMaxRecentTasksStatic() / 6;
+        return RECENTS_APP_LIMIT_DEFAULT;
     }
 
     /**
@@ -553,7 +557,7 @@
      * @hide
      */
     static public int getMaxAppRecentsLimitStatic() {
-        return getMaxRecentTasksStatic() / 2;
+        return RECENTS_APP_LIMIT_MAX;
     }
 
     /**