Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80e29b66 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Fix issue #17179314: Make recents limits consistent" into lmp-dev

parents d22a6677 852975d5
Loading
Loading
Loading
Loading
+32 −3
Original line number Diff line number Diff line
@@ -67,6 +67,8 @@ public class ActivityManager {
    private static String TAG = "ActivityManager";
    private static boolean localLOGV = false;

    private static int gMaxRecentTasks = -1;

    private final Context mContext;
    private final Handler mHandler;

@@ -472,6 +474,33 @@ public class ActivityManager {
                !Resources.getSystem().getBoolean(com.android.internal.R.bool.config_avoidGfxAccel);
    }

    /**
     * Return the maximum number of recents entries that we will maintain and show.
     * @hide
     */
    static public int getMaxRecentTasksStatic() {
        if (gMaxRecentTasks < 0) {
            return gMaxRecentTasks = isLowRamDeviceStatic() ? 50 : 100;
        }
        return gMaxRecentTasks;
    }

    /**
     * Return the default limit on the number of recents that an app can make.
     * @hide
     */
    static public int getDefaultAppRecentsLimitStatic() {
        return getMaxRecentTasksStatic() / 6;
    }

    /**
     * Return the maximum limit on the number of recents that an app can make.
     * @hide
     */
    static public int getMaxAppRecentsLimitStatic() {
        return getMaxRecentTasksStatic() / 2;
    }

    /**
     * Information you can set and retrieve about the current activity within the recent task list.
     */
@@ -1184,13 +1213,13 @@ public class ActivityManager {
        public void writeToParcel(Parcel dest, int flags) {
            if (mainThumbnail != null) {
                dest.writeInt(1);
                mainThumbnail.writeToParcel(dest, 0);
                mainThumbnail.writeToParcel(dest, flags);
            } else {
                dest.writeInt(0);
            }
            if (thumbnailFileDescriptor != null) {
                dest.writeInt(1);
                thumbnailFileDescriptor.writeToParcel(dest, 0);
                thumbnailFileDescriptor.writeToParcel(dest, flags);
            } else {
                dest.writeInt(0);
            }
+2 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import static android.content.pm.PackageManager.INSTALL_PARSE_FAILED_NOT_APK;
import static android.content.pm.PackageManager.INSTALL_PARSE_FAILED_NO_CERTIFICATES;
import static android.content.pm.PackageManager.INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION;

import android.app.ActivityManager;
import android.content.ComponentName;
import android.content.Intent;
import android.content.IntentFilter;
@@ -3077,7 +3078,7 @@ public class PackageParser {
                    ActivityInfo.DOCUMENT_LAUNCH_NONE);
            a.info.maxRecents = sa.getInt(
                    com.android.internal.R.styleable.AndroidManifestActivity_maxRecents,
                    15);
                    ActivityManager.getDefaultAppRecentsLimitStatic());
            a.info.screenOrientation = sa.getInt(
                    com.android.internal.R.styleable.AndroidManifestActivity_screenOrientation,
                    ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
+0 −2
Original line number Diff line number Diff line
@@ -145,8 +145,6 @@
    <integer name="recents_animate_task_view_remove_duration">250</integer>
    <!-- The minimum alpha for the dim applied to cards that go deeper into the stack. -->
    <integer name="recents_max_task_stack_view_dim">96</integer>
    <!-- The number of tasks that RecentsTaskLoader should load. -->
    <integer name="recents_max_num_tasks_to_load">50</integer>
    <!-- The delay to enforce between each alt-tab key press. -->
    <integer name="recents_alt_tab_key_delay">200</integer>
    <!-- Transposes the recents layout in landscape. -->
+2 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.recents;

import android.app.ActivityManager;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
@@ -187,7 +188,7 @@ public class RecentsConfiguration {
                res.getInteger(R.integer.recents_filter_animate_new_views_duration);

        // Loading
        maxNumTasksToLoad = res.getInteger(R.integer.recents_max_num_tasks_to_load);
        maxNumTasksToLoad = ActivityManager.getMaxRecentTasksStatic();

        // Search Bar
        searchBarSpaceHeightPx = res.getDimensionPixelSize(R.dimen.recents_search_bar_space_height);
+383 −88

File changed.

Preview size limit exceeded, changes collapsed.

Loading