Commit fe15aa04 authored by liberato@chromium.org's avatar liberato@chromium.org Committed by Commit Bot

Allow surfaceDestroyed on the wrong thread on P and later.

Previously, we allowed P to call surfaceDestroyed on the UI thread,
rather than the dialog overlay thread.  This was due to a framework
bug.  However, it seems that the bug still exists in Q, so the
workaround is allowed for >= P instead.

Bug: 1029445
Change-Id: Idd0eb15f388450d8cb91c63fe87356b34c9571f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1985234Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Reviewed-by: default avatarThomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Frank Liberato <liberato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728075}
parent 87b9d298
...@@ -171,8 +171,8 @@ class DialogOverlayCore { ...@@ -171,8 +171,8 @@ class DialogOverlayCore {
// since we're blocking the UI thread. To avoid that, we just give up on synchronous // since we're blocking the UI thread. To avoid that, we just give up on synchronous
// shutdown and hope for the best. // shutdown and hope for the best.
// //
// We only allow it on P, though, since that's the only place it should be observed. // We only allow it on P and later, since it's observed on both P and Q.
if (Build.VERSION.SDK_INT != Build.VERSION_CODES.P) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
assertProperThread(); assertProperThread();
} else if (mLooper != Looper.myLooper()) { } else if (mLooper != Looper.myLooper()) {
Log.e(TAG, "surfaceDestroyed called on wrong thread. Avoiding proper shutdown."); Log.e(TAG, "surfaceDestroyed called on wrong thread. Avoiding proper shutdown.");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment