Enable am profiling for apps profileable by shell
This change allows apps that are marked as profileable by shell to be profiled with am profile. Note that debuggable forces isProfileableByShell to true. Fixes: 118835065 Test: atest cts/tests/framework/base/activitymanager/src/android/server/am/ActivityManagerAmProfileTests.java Note, tested on user build Change-Id: I174115dd9a3635ca4df3600eec994d06739d6ff8
This commit is contained in:
@@ -7892,8 +7892,9 @@ public class ActivityManagerService extends IActivityManager.Stub
|
||||
synchronized (this) {
|
||||
boolean isDebuggable = "1".equals(SystemProperties.get(SYSTEM_DEBUGGABLE, "0"));
|
||||
if (!isDebuggable) {
|
||||
if ((app.flags & ApplicationInfo.FLAG_DEBUGGABLE) == 0) {
|
||||
throw new SecurityException("Process not debuggable: " + app.packageName);
|
||||
if (!app.isProfileableByShell()) {
|
||||
throw new SecurityException("Process not debuggable, "
|
||||
+ "and not profileable by shell: " + app.packageName);
|
||||
}
|
||||
}
|
||||
mProfileData.setProfileApp(processName);
|
||||
|
||||
Reference in New Issue
Block a user