Bug 852070 - Update ANRReporter to use ThreadUtils. r=jchen

This commit is contained in:
Kartikaya Gupta 2013-03-18 15:28:48 +01:00
parent 604e47fa2a
commit 78ac709f7c
2 changed files with 5 additions and 3 deletions

View File

@ -5,6 +5,8 @@
package org.mozilla.gecko;
import org.mozilla.gecko.util.ThreadUtils;
import android.app.ActivityManager;
import android.content.BroadcastReceiver;
import android.content.Context;
@ -452,10 +454,10 @@ public final class ANRReporter extends BroadcastReceiver
}
return;
}
if (GeckoApp.mAppContext != null && GeckoApp.mAppContext.mMainHandler != null) {
if (ThreadUtils.getUiHandler() != null) {
mPendingANR = true;
// detect when the main thread gets unstuck
GeckoApp.mAppContext.mMainHandler.post(new Runnable() {
ThreadUtils.postToUiThread(new Runnable() {
@Override
public void run() {
// okay to reset mPendingANR on main thread

View File

@ -40,7 +40,7 @@ public class GeckoActivity extends Activity implements GeckoActivityStatus {
#ifdef MOZ_ANDROID_ANR_REPORTER
@Override
public void onCreate(Bundle savedInstanceState) {
public void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ANRReporter.register(getApplicationContext());
}