diff options
| author | 2018-09-04 14:37:19 +0000 | |
|---|---|---|
| committer | 2018-09-04 14:37:19 +0000 | |
| commit | a8aaa38d5134ab6067c08a1e5db2ab8173641048 (patch) | |
| tree | e8b4f67abce854eb0a9f2e3916d366bb4c2c459e | |
| parent | c52784e25650a19db3f262aaf0cb387654092454 (diff) | |
| parent | ddcd54813b01b01d4d5734ad69344201fb5c628c (diff) | |
Merge "[Magnifier-60] Fix race condition after #dismiss"
| -rw-r--r-- | core/java/android/widget/Magnifier.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/java/android/widget/Magnifier.java b/core/java/android/widget/Magnifier.java index 3280d477b23d..8e2786d51a43 100644 --- a/core/java/android/widget/Magnifier.java +++ b/core/java/android/widget/Magnifier.java @@ -215,11 +215,11 @@ public final class Magnifier { final Point windowCoords = getCurrentClampedWindowCoordinates(); final InternalPopupWindow currentWindowInstance = mWindow; sPixelCopyHandlerThread.getThreadHandler().post(() -> { - if (mWindow != currentWindowInstance) { - // The magnifier was dismissed (and maybe shown again) in the meantime. - return; - } synchronized (mLock) { + if (mWindow != currentWindowInstance) { + // The magnifier was dismissed (and maybe shown again) in the meantime. + return; + } mWindow.setContentPositionForNextDraw(windowCoords.x, windowCoords.y); } }); |