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

Commit 2eea37ad authored by wilsonshih's avatar wilsonshih
Browse files

Add feature flag for release snapshot memory actively.

Flag to control release task snapshot memory aggressively.

Bug: 238206323
Test: N/A
Change-Id: I62094973adbe768deb24adf320eb524877f78e01
parent b66fb491
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ import android.os.SystemClock;
import android.view.Surface;
import android.view.WindowInsetsController;

import com.android.window.flags.Flags;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@@ -334,7 +336,8 @@ public class TaskSnapshot implements Parcelable {
     */
    public synchronized void removeReference(@ReferenceFlags int usage) {
        mInternalReferences &= ~usage;
        if (mInternalReferences == 0 && mSnapshot != null && !mSnapshot.isClosed()) {
        if (Flags.releaseSnapshotAggressively() && mInternalReferences == 0 && mSnapshot != null
                && !mSnapshot.isClosed()) {
            mSnapshot.close();
        }
    }
+8 −0
Original line number Diff line number Diff line
@@ -164,3 +164,11 @@ flag {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
    name: "release_snapshot_aggressively"
    namespace: "windowing_frontend"
    description: "Actively release task snapshot memory"
    bug: "238206323"
    is_fixed_read_only: true
}
 No newline at end of file