summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author randy.jeong <randy.jeong@samsung.com> 2019-05-29 10:43:39 +0900
committer Andreas Gampe <agampe@google.com> 2019-07-15 23:16:49 +0000
commit2526b492a4810577c82340a691c5aa0dbec7aef2 (patch)
treed155673cf8f4435a4cf53cbd91943f635a8b927c
parent73b4106d7e0fed136a40afee96e2e186a751d31e (diff)
[FRAMEWORK] Ignore signal registration for debugging
It's difficult to identify native crash/error of 3rd party app. Because they can control their app with own signal handling. Therefore I would like to support the way to ignore signal registration in 3rd party app with the specific property. To enable this, do just setprop "debug.ignoreappsignalhandler 1". Test: test app to hook signal, then setprop debug.ignoreappsignalhandler 1 Change-Id: I2af98a0f58e5ac039eab0ebe9c3780357aca7820 Merged-In: I2af98a0f58e5ac039eab0ebe9c3780357aca7820 Signed-off-by: randy.jeong <randy.jeong@samsung.com>
-rw-r--r--core/java/com/android/internal/os/Zygote.java8
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java3
2 files changed, 11 insertions, 0 deletions
diff --git a/core/java/com/android/internal/os/Zygote.java b/core/java/com/android/internal/os/Zygote.java
index 14b511df390b..cfe05c966a79 100644
--- a/core/java/com/android/internal/os/Zygote.java
+++ b/core/java/com/android/internal/os/Zygote.java
@@ -99,6 +99,14 @@ public final class Zygote {
*/
public static final int USE_APP_IMAGE_STARTUP_CACHE = 1 << 16;
+ /**
+ * When set, application specified signal handlers are not chained (i.e, ignored)
+ * by the runtime.
+ *
+ * Used for debugging only. Usage: set debug.ignoreappsignalhandler to 1.
+ */
+ public static final int DEBUG_IGNORE_APP_SIGNAL_HANDLER = 1 << 17;
+
/** No external storage should be mounted. */
public static final int MOUNT_EXTERNAL_NONE = IVold.REMOUNT_MODE_NONE;
/** Default external storage should be mounted. */
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 5ebd17360961..4eafe7c3eca0 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -4309,6 +4309,9 @@ public class ActivityManagerService extends IActivityManager.Stub
if ("1".equals(SystemProperties.get("debug.assert"))) {
runtimeFlags |= Zygote.DEBUG_ENABLE_ASSERT;
}
+ if ("1".equals(SystemProperties.get("debug.ignoreappsignalhandler"))) {
+ runtimeFlags |= Zygote.DEBUG_IGNORE_APP_SIGNAL_HANDLER;
+ }
if (mNativeDebuggingApp != null && mNativeDebuggingApp.equals(app.processName)) {
// Enable all debug flags required by the native debugger.
runtimeFlags |= Zygote.DEBUG_ALWAYS_JIT; // Don't interpret anything