mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 852070 - Update ANRReporter to use ThreadUtils. r=jchen
This commit is contained in:
parent
604e47fa2a
commit
78ac709f7c
@ -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
|
||||
|
@ -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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user