diff options
author | Kristian Monsen <kristianm@google.com> | 2013-01-18 14:50:07 -0800 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2013-01-18 14:50:07 -0800 |
commit | 0a30328c10367f57834d7e8597832b6af00f5240 (patch) | |
tree | 14c96a7ebd9f7d21abbfadb106a51ab90fa63bb6 /tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTestActivity.java | |
parent | ebf7c74361baefb826591bd90cdacd9244a2eb59 (diff) |
Better detecting if current threasd is main thread
Old approach got broken after:
https://googleplex-android-review.googlesource.com/#/c/266421/2
Change-Id: I12ae23efdbaebd8ba24acb1b7eff75c912d24f1d
Diffstat (limited to 'tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTestActivity.java')
-rw-r--r-- | tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTestActivity.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTestActivity.java b/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTestActivity.java index 9a4e99ea7bda..22b587fe98e6 100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTestActivity.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTestActivity.java @@ -22,6 +22,7 @@ import android.graphics.Bitmap; import android.net.http.SslError; import android.os.Bundle; import android.os.Handler; +import android.os.Looper; import android.os.Message; import android.util.Log; import android.view.ViewGroup; @@ -184,7 +185,7 @@ public class ReliabilityTestActivity extends Activity { } private final void validateNotAppThread() { - if (ActivityThread.currentActivityThread() != null) { + if (Looper.myLooper() == Looper.getMainLooper()) { throw new RuntimeException( "This method can not be called from the main application thread"); } |