diff options
author | 2019-03-26 15:19:46 +0800 | |
---|---|---|
committer | 2019-03-26 20:48:33 +0800 | |
commit | bac1b4e84a79d75f7576ce7ec3713d017ce05a9d (patch) | |
tree | 5cf6b2241a3ea20f4f92c14d40d1be0ff0ce37a3 | |
parent | aaa9b118f936f121bb1d5c6ad7944af18d4234a8 (diff) |
Add more debug logs for directory update process
Bug: 111869773
Test: manual
Change-Id: I4b234de4e5af7f406bf032dc38118043f6373313
-rw-r--r-- | src/com/android/documentsui/ContentLock.java | 12 | ||||
-rw-r--r-- | src/com/android/documentsui/DirectoryLoader.java | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/com/android/documentsui/ContentLock.java b/src/com/android/documentsui/ContentLock.java index 1a01f63a2..239bf7a66 100644 --- a/src/com/android/documentsui/ContentLock.java +++ b/src/com/android/documentsui/ContentLock.java @@ -15,6 +15,10 @@ */ package com.android.documentsui; +import static com.android.documentsui.base.SharedMinimal.DEBUG; + +import android.util.Log; + import androidx.annotation.GuardedBy; import androidx.annotation.Nullable; import androidx.recyclerview.selection.OperationMonitor; @@ -27,6 +31,8 @@ import androidx.recyclerview.selection.OperationMonitor; */ public final class ContentLock { + private static final String TAG = "ContentLock"; + private final OperationMonitor mMonitor = new OperationMonitor(); @GuardedBy("this") @@ -34,6 +40,9 @@ public final class ContentLock { public ContentLock() { mMonitor.addListener(() -> { + if (DEBUG) { + Log.d(TAG, "monitor listener, is locked : " + isLocked()); + } if (!isLocked()) { synchronized (this) { final Runnable callback = mCallback; @@ -62,6 +71,9 @@ public final class ContentLock { * (replacing any previous set Runnables). */ public synchronized void runWhenUnlocked(Runnable runnable) { + if (DEBUG) { + Log.d(TAG, "run when unlock, is locked : " + isLocked()); + } if (!isLocked()) { runnable.run(); } else { diff --git a/src/com/android/documentsui/DirectoryLoader.java b/src/com/android/documentsui/DirectoryLoader.java index b95d53e2f..d65b4c353 100644 --- a/src/com/android/documentsui/DirectoryLoader.java +++ b/src/com/android/documentsui/DirectoryLoader.java @@ -16,6 +16,7 @@ package com.android.documentsui; +import static com.android.documentsui.base.SharedMinimal.DEBUG; import static com.android.documentsui.base.SharedMinimal.VERBOSE; import android.content.ContentProviderClient; @@ -258,6 +259,9 @@ public class DirectoryLoader extends AsyncTaskLoader<DirectoryResult> { @Override public void onChange(boolean selfChange) { + if (DEBUG) { + Log.d(TAG, "Directory content updated."); + } mLock.runWhenUnlocked(mContentChangedCallback); } } |