Skip to content

Commit 06df4a4

Browse files
MortimerGorokeianhzo
authored andcommitted
Add a user property to disable app relaunch on crash (Igalia#656)
1 parent 48d0c5e commit 06df4a4

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ geckoViewLocalX86=/path/to/your/build/geckoview-nightly-x86-64.0.20180924100359.
9292
- When using the native debugger you can ignore the first SIGSEGV: address access protected stop in GV thread. It's not a crash; you can click *Resume* to continue debugging.
9393
- On some platforms such as Oculus Go the native debugger stops on each input event. You can set this LLDB post-attach command in Android Studio to fix the problem: `pro hand -p true -s false SIGILL`
9494
- You can use `adb shell am start -a android.intent.action.VIEW -d "https://aframe.io" org.mozilla.vrbrowser/org.mozilla.vrbrowser.VRBrowserActivity` to load a URL from the command line
95-
- You can use `adb shell setprop debug.oculus.enableVideoCapture 1`to record videos on the Oculus Go. Remember to disable it when your video is ready.
95+
- You can use `adb shell setprop debug.oculus.enableVideoCapture 1` to record videos on the Oculus Go. Remember to disable it when your video is ready.
96+
- You can set `disableCrashRestart=true` in the gradle `user.properties` to disable app relaunch on crash.
9697

9798

9899
## Experimental Servo support

app/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ def getGitHash = { ->
1010
return stdout.toString().trim()
1111
}
1212

13+
def getCrashRestartDisabled = { ->
14+
if (gradle.hasProperty("disableCrashRestart")) {
15+
return gradle.disableCrashRestart
16+
}
17+
return "false"
18+
}
19+
1320
android {
1421
compileSdkVersion 27
1522
defaultConfig {
@@ -19,6 +26,7 @@ android {
1926
versionCode 1
2027
versionName "1.1"
2128
buildConfigField "String", "GIT_HASH", "\"${getGitHash()}\""
29+
buildConfigField "Boolean", "DISABLE_CRASH_RESTART", getCrashRestartDisabled()
2230
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
2331
externalNativeBuild {
2432
cmake {

app/src/common/shared/org/mozilla/vrbrowser/crashreporting/CrashReporterService.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import android.util.Log;
1111

1212
import org.mozilla.geckoview.GeckoRuntime;
13+
import org.mozilla.vrbrowser.BuildConfig;
1314
import org.mozilla.vrbrowser.R;
1415
import org.mozilla.vrbrowser.VRBrowserActivity;
1516

@@ -39,7 +40,8 @@ protected void onHandleWork(@NonNull Intent intent) {
3940
if (GeckoRuntime.ACTION_CRASHED.equals(action)) {
4041
boolean fatal = intent.getBooleanExtra(GeckoRuntime.EXTRA_CRASH_FATAL, false);
4142

42-
if (fatal) {
43+
44+
if (fatal && !BuildConfig.DISABLE_CRASH_RESTART) {
4345
Log.d(LOGTAG, "======> NATIVE CRASH PARENT" + intent);
4446
final int pid = Process.myPid();
4547
final ActivityManager activityManager = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE);

0 commit comments

Comments
 (0)