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

Commit f92e52f2 authored by Shai Barack's avatar Shai Barack
Browse files

Handle >=TRIM_MEMORY_BACKGROUND

Other levels are no longer sent starting with Android UDC.
Also, handling should check for >=levels, never =levels.

Bug: 329427668
Change-Id: Id4ada80b4f07a048d530f7cb316b0a8f5cba6a04
parent d0a4db8c
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -486,8 +486,7 @@ public abstract class ViewCapture {

        @Override
        public void onTrimMemory(int level) {
            if (ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL == level
                    || ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW == level) {
            if (level >= ComponentCallbacks2.TRIM_MEMORY_BACKGROUND) {
                mNodesBg = new ViewPropertyRef[0];
                mFrameTimesNanosBg = new long[0];
                if (mRoot != null && mRoot.getContext() != null) {
@@ -505,7 +504,7 @@ public abstract class ViewCapture {

        @Override
        public void onLowMemory() {
            onTrimMemory(ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW);
            onTrimMemory(ComponentCallbacks2.TRIM_MEMORY_BACKGROUND);
        }
    }