Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public class CrashReporterService extends JobIntentService {
// Threshold used to fix Infinite restart loop on startup crashes.
// See https://github.com/MozillaReality/FirefoxReality/issues/651
public static final long MAX_RESTART_COUNT = 2;
private static final int MAX_PID_CHECK_COUNT = 5;

private int mPidCheckCount = 0;

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Expand Down Expand Up @@ -71,14 +74,15 @@ protected void onHandleWork(@NonNull Intent intent) {
}
}

if (!otherProcessesFound) {
if (!otherProcessesFound || (mPidCheckCount > MAX_PID_CHECK_COUNT)) {
intent.setClass(CrashReporterService.this, VRBrowserActivity.class);
intent.setPackage(BuildConfig.APPLICATION_ID);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
break;

} else {
mPidCheckCount++;
try {
Thread.sleep(PID_CHECK_INTERVAL);
} catch (InterruptedException e) {
Expand Down