diff options
author | Henry Fang <quxiangfang@google.com> | 2023-07-19 20:41:36 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-07-19 20:41:36 +0000 |
commit | 7c826a7d3a7f3ab67a7820d8b7a240a10bf6caef (patch) | |
tree | e8e684930eec2459ee13c27d0ca2a0cdbefcd577 | |
parent | 56651135da721f8c240bf577aac298a1c31e30bb (diff) | |
parent | b14765a250281947ce1a26daeb9efb69104b5c7a (diff) | |
download | TvProvider-7c826a7d3a7f3ab67a7820d8b7a240a10bf6caef.tar.gz |
Merge "TvProvider: Reduce synchronized block" into main am: 6b0378d616 am: 5ffa88ac6f am: 3afae03f80 am: b14765a250
Original change: https://android-review.googlesource.com/c/platform/packages/providers/TvProvider/+/2661677
Change-Id: I13146a51488516f552f4e5fd169ed6d505267992
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | src/com/android/providers/tv/TransientRowHelper.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/com/android/providers/tv/TransientRowHelper.java b/src/com/android/providers/tv/TransientRowHelper.java index 7054a0c..c289633 100644 --- a/src/com/android/providers/tv/TransientRowHelper.java +++ b/src/com/android/providers/tv/TransientRowHelper.java @@ -71,11 +71,13 @@ public class TransientRowHelper { /** * Ensures that transient rows, inserted previously before current boot, are deleted. */ - public synchronized void ensureOldTransientRowsDeleted() { - if (mTransientRowsDeleted) { - return; + public void ensureOldTransientRowsDeleted() { + synchronized (this) { + if (mTransientRowsDeleted) { + return; + } + mTransientRowsDeleted = true; } - mTransientRowsDeleted = true; if (getLastDeletionBootCount() >= getBootCount()) { // This can be the second execution of TvProvider after boot since system kills // TvProvider in low memory conditions. If this is the case, we shouldn't delete |