Merge changes from topic "ril-mem-monitor" into udc-dev

* changes:
  Add ril memory monitor
  rild: allow rild to ptrace
diff --git a/pixel_ril/ril.mk b/pixel_ril/ril.mk
index 03f7f24..37274aa 100644
--- a/pixel_ril/ril.mk
+++ b/pixel_ril/ril.mk
@@ -9,6 +9,10 @@
 
 PRODUCT_PACKAGES += ril-extension
 
-PRODUCT_SOONG_NAMESPACES += vendor/google/tools/ril-extension-service
+PRODUCT_PACKAGES_DEBUG += libgooglerilmemmonitor
+
+PRODUCT_SOONG_NAMESPACES += \
+    vendor/google/tools/ril-extension-service \
+    vendor/google/tools/ril-mem-monitor
 
 USE_GOOGLE_RIL_EXT := true
diff --git a/pixel_ril/sepolicy/rild.te b/pixel_ril/sepolicy/rild.te
index 3bb2cd7..55bffee 100644
--- a/pixel_ril/sepolicy/rild.te
+++ b/pixel_ril/sepolicy/rild.te
@@ -1,2 +1,7 @@
 add_service(rild, hal_ril_ext_service)
 binder_call(rild, rilextensionservice_app)
+
+# Allow rild to ptrace for memory leak detection
+userdebug_or_eng(`
+allow rild self:process ptrace;
+')