am 7c306fd5: Merge "rild: enable tombstone on RIL crash"

* commit '7c306fd58062476e53d3f424b4b7a5797069c235':
  rild: enable tombstone on RIL crash
diff --git a/rild/rild.c b/rild/rild.c
index 8e479dc..5757a39 100644
--- a/rild/rild.c
+++ b/rild/rild.c
@@ -93,6 +93,8 @@
  * Our group, cache, was set by init.
  */
 void switchUser() {
+    char debuggable[PROP_VALUE_MAX];
+
     prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);
     setuid(AID_RADIO);
 
@@ -114,6 +116,15 @@
         RLOGE("capset failed: %s", strerror(errno));
         exit(EXIT_FAILURE);
     }
+
+    /*
+     * Debuggable build only:
+     * Set DUMPABLE that was cleared by setuid() to have tombstone on RIL crash
+     */
+    property_get("ro.debuggable", debuggable, "0");
+    if (strcmp(debuggable, "1") == 0) {
+        prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+    }
 }
 
 int main(int argc, char **argv)