diff options
Diffstat (limited to 'tests/BrowserPowerTest/src')
-rw-r--r-- | tests/BrowserPowerTest/src/com/android/browserpowertest/PowerTestActivity.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/BrowserPowerTest/src/com/android/browserpowertest/PowerTestActivity.java b/tests/BrowserPowerTest/src/com/android/browserpowertest/PowerTestActivity.java index 1b72486a075b..ab60f21a610b 100644 --- a/tests/BrowserPowerTest/src/com/android/browserpowertest/PowerTestActivity.java +++ b/tests/BrowserPowerTest/src/com/android/browserpowertest/PowerTestActivity.java @@ -21,6 +21,7 @@ import android.app.ActivityThread; import android.graphics.Bitmap; import android.os.Bundle; import android.os.Handler; +import android.os.Looper; import android.os.Message; import android.util.Log; import android.view.ViewGroup; @@ -180,7 +181,7 @@ public class PowerTestActivity 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"); } |