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

Commit 5bf7e675 authored by Varad Deshmukh's avatar Varad Deshmukh Committed by Steve Kondik
Browse files

Modify GC Delay to include subsequent launches. (fix)

Application launches for apps like GMS Music
and Maps lead to explicit GC's due to Binder
activity in the SystemServer. This change
allows delaying the GC for 3 seconds after
the application is launched. Subsequent launches
or previously killed applications with existing
activity records are also now covered.

Change-Id: I1a915d5b8a8bf752991a429328fe398ff4f1eae2
parent 1175798d
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -2717,6 +2717,8 @@ public final class ActivityStackSupervisor implements DisplayListener {

    ActivityRecord findTaskLocked(ActivityRecord r) {
        if (DEBUG_TASKS) Slog.d(TAG, "Looking for task of " + r);
        /* Delay Binder Explicit GC during application launch */
        BinderInternal.modifyDelayedGcParams();
        for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; --displayNdx) {
            final ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks;
            for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) {
@@ -2737,14 +2739,8 @@ public final class ActivityStackSupervisor implements DisplayListener {
                }
            }
        }
        /* Delay Binder Explicit GC during application launch */
        BinderInternal.modifyDelayedGcParams();

        mPm.cpuBoost(2000 * 1000);

        /* Delay Binder Explicit GC during application launch */
        BinderInternal.modifyDelayedGcParams();

        if (DEBUG_TASKS) Slog.d(TAG, "No task found");
        return null;
    }