Initialize reference count for SnapshotTracker
Because there can be more than one onTaskSnapshotChanged listeners in a process, initialize the reference count based on the listener size for SnapshotTracker, to prevent one thread closing the snapshot while others are still using it. Also remove the extra close buffer request when TaskStackChangeListeners#impl handle ON_TASK_SNAPSHOT_CHANGED, ThumbnailData#fromSnapshot will do close buffer already. Flag: com.android.window.flags.reduce_task_snapshot_memory_usage Bug: 438037933 Test: monitor the same snapshot object will only request to close buffer once from other tests after SystemUITests:NavigationBarTest Change-Id: I31e94bf377b4dab998691ee962172dcee082b956
Loading
Please register or sign in to comment