Merge "Allow non-empty namespaces in system uid to cancel all jobs" into udc-dev am: 8936f814f9

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22133473

Change-Id: I56d915cc8c511749be86a71471404e59a9027a8a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2023-03-23 08:44:06 +00:00
committed by Automerger Merge Worker

View File

@@ -1812,7 +1812,9 @@ public class JobSchedulerService extends com.android.server.SystemService
private boolean cancelJobsForUid(int uid, boolean includeSourceApp,
boolean namespaceOnly, @Nullable String namespace,
@JobParameters.StopReason int reason, int internalReasonCode, String debugReason) {
if (uid == Process.SYSTEM_UID) {
// Non-null system namespace means the cancelling is limited to the namespace
// and won't cause issues for the system at large.
if (uid == Process.SYSTEM_UID && (!namespaceOnly || namespace == null)) {
Slog.wtfStack(TAG, "Can't cancel all jobs for system uid");
return false;
}