This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a Java global exception handler (#602)
- Loading branch information
1 parent
d8cdd0a
commit 6ba3873
Showing
3 changed files
with
67 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/src/common/shared/org/mozilla/vrbrowser/GlobalExceptionHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.mozilla.vrbrowser; | ||
|
||
import android.support.annotation.NonNull; | ||
import android.util.Log; | ||
|
||
import org.mozilla.gecko.CrashHandler; | ||
|
||
public class GlobalExceptionHandler { | ||
|
||
private static final String LOGTAG = "VRB"; | ||
|
||
private static GlobalExceptionHandler mInstance; | ||
|
||
public static synchronized @NonNull | ||
GlobalExceptionHandler register() { | ||
if (mInstance == null) { | ||
mInstance = new GlobalExceptionHandler(); | ||
mInstance.mCrashHandler = new CrashHandler(CrashReporterService.class); | ||
Log.d(LOGTAG, "======> GlobalExceptionHandler registered"); | ||
} | ||
|
||
return mInstance; | ||
} | ||
|
||
private CrashHandler mCrashHandler; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters