Loading services/core/java/com/android/server/am/ActivityManagerShellCommand.java +13 −2 Original line number Diff line number Diff line Loading @@ -1200,8 +1200,19 @@ final class ActivityManagerShellCommand extends ShellCommand { } catch (NumberFormatException e) { packageName = arg; } mInterface.crashApplicationWithType(-1, pid, packageName, userId, "shell-induced crash", int[] userIds = (userId == UserHandle.USER_ALL) ? mInternal.mUserController.getUserIds() : new int[]{userId}; for (int id : userIds) { if (mInternal.mUserController.hasUserRestriction( UserManager.DISALLOW_DEBUGGING_FEATURES, id)) { getOutPrintWriter().println( "Shell does not have permission to crash packages for user " + id); continue; } mInterface.crashApplicationWithType(-1, pid, packageName, id, "shell-induced crash", false, CrashedByAdbException.TYPE_ID); } return 0; } Loading services/core/java/com/android/server/am/AppErrors.java +11 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import android.app.ActivityOptions; import android.app.AnrController; import android.app.ApplicationErrorReport; import android.app.ApplicationExitInfo; import android.app.RemoteServiceException.CrashedByAdbException; import android.app.usage.UsageStatsManager; import android.content.ActivityNotFoundException; import android.content.Context; Loading Loading @@ -523,6 +524,16 @@ class AppErrors { return; } if (exceptionTypeId == CrashedByAdbException.TYPE_ID) { String[] packages = proc.getPackageList(); for (int i = 0; i < packages.length; i++) { if (mService.mPackageManagerInt.isPackageStateProtected(packages[i], proc.userId)) { Slog.w(TAG, "crashApplication: Can not crash protected package " + packages[i]); return; } } } proc.scheduleCrashLocked(message, exceptionTypeId, extras); if (force) { // If the app is responsive, the scheduled crash will happen as expected Loading Loading
services/core/java/com/android/server/am/ActivityManagerShellCommand.java +13 −2 Original line number Diff line number Diff line Loading @@ -1200,8 +1200,19 @@ final class ActivityManagerShellCommand extends ShellCommand { } catch (NumberFormatException e) { packageName = arg; } mInterface.crashApplicationWithType(-1, pid, packageName, userId, "shell-induced crash", int[] userIds = (userId == UserHandle.USER_ALL) ? mInternal.mUserController.getUserIds() : new int[]{userId}; for (int id : userIds) { if (mInternal.mUserController.hasUserRestriction( UserManager.DISALLOW_DEBUGGING_FEATURES, id)) { getOutPrintWriter().println( "Shell does not have permission to crash packages for user " + id); continue; } mInterface.crashApplicationWithType(-1, pid, packageName, id, "shell-induced crash", false, CrashedByAdbException.TYPE_ID); } return 0; } Loading
services/core/java/com/android/server/am/AppErrors.java +11 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import android.app.ActivityOptions; import android.app.AnrController; import android.app.ApplicationErrorReport; import android.app.ApplicationExitInfo; import android.app.RemoteServiceException.CrashedByAdbException; import android.app.usage.UsageStatsManager; import android.content.ActivityNotFoundException; import android.content.Context; Loading Loading @@ -523,6 +524,16 @@ class AppErrors { return; } if (exceptionTypeId == CrashedByAdbException.TYPE_ID) { String[] packages = proc.getPackageList(); for (int i = 0; i < packages.length; i++) { if (mService.mPackageManagerInt.isPackageStateProtected(packages[i], proc.userId)) { Slog.w(TAG, "crashApplication: Can not crash protected package " + packages[i]); return; } } } proc.scheduleCrashLocked(message, exceptionTypeId, extras); if (force) { // If the app is responsive, the scheduled crash will happen as expected Loading