Merge "Add more logging when view methods are called from the wrong thread" into tm-qpr-dev am: 7f20b9db07 am: 59bacd6287

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21553701

Change-Id: Ide4ca2ea7571edce1fae5f0d4910fb9643c2d667
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Winson Chung
2023-03-01 12:37:44 +00:00
committed by Automerger Merge Worker

View File

@@ -10078,9 +10078,12 @@ public final class ViewRootImpl implements ViewParent,
}
void checkThread() {
if (mThread != Thread.currentThread()) {
Thread current = Thread.currentThread();
if (mThread != current) {
throw new CalledFromWrongThreadException(
"Only the original thread that created a view hierarchy can touch its views.");
"Only the original thread that created a view hierarchy can touch its views."
+ " Expected: " + mThread.getName()
+ " Calling: " + current.getName());
}
}