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

Commit e5e673af authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Add feature flag for release snapshot memory actively." into main

parents 9db036da 2eea37ad
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