Allow apps to be profileable by trusted system services.
Bug: 170284829
Change-Id: Ie5dc3669bc8e7ce545484b1ec55e29fe137cf7e4
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index a4e5550..10999dc 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -1093,7 +1093,7 @@
ScopedObjectAccess soa(Thread::Current());
if (IsPerfettoHprofEnabled() &&
- (Dbg::IsJdwpAllowed() || IsProfileableFromShell() || IsJavaDebuggable() ||
+ (Dbg::IsJdwpAllowed() || IsProfileable() || IsProfileableFromShell() || IsJavaDebuggable() ||
Runtime::Current()->IsSystemServer())) {
std::string err;
ScopedTrace tr("perfetto_hprof init.");
@@ -1103,7 +1103,7 @@
}
}
if (IsPerfettoJavaHeapStackProfEnabled() &&
- (Dbg::IsJdwpAllowed() || IsProfileableFromShell() || IsJavaDebuggable() ||
+ (Dbg::IsJdwpAllowed() || IsProfileable() || IsProfileableFromShell() || IsJavaDebuggable() ||
Runtime::Current()->IsSystemServer())) {
std::string err;
ScopedTrace tr("perfetto_javaheapprof init.");