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

Commit 550d5da7 authored by Winson Chung's avatar Winson Chung Committed by android-build-merger
Browse files

Merge "Run explicit GC to clear references to bitmaps earlier." into oc-dev

am: fd6b3c6d

Change-Id: I262857f51aff127c3e1c4a223e22e7129060a9e7
parents a3da26e1 fd6b3c6d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -514,6 +514,9 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
            RecentsActivityLaunchState launchState = config.getLaunchState();
            launchState.reset();
        }

        // Force a gc to attempt to clean up bitmap references more quickly (b/38258699)
        Recents.getSystemServices().gc();
    }

    @Override
+13 −0
Original line number Diff line number Diff line
@@ -361,6 +361,19 @@ public class SystemServicesProxy {
        return sSystemServicesProxy;
    }

    /**
     * Requests a gc() from the background thread.
     */
    public void gc() {
        BackgroundThread.getHandler().post(new Runnable() {
            @Override
            public void run() {
                System.gc();
                System.runFinalization();
            }
        });
    }

    /**
     * @return whether the provided {@param className} is blacklisted
     */