Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae929258 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Ensure security log broadcast is sent to the correct user on Headless." into main

parents 76627a01 51c6761d
Loading
Loading
Loading
Loading
+12 −2
Original line number Original line Diff line number Diff line
@@ -214,3 +214,13 @@ flag {
  description: "Guards a new flow for recursive required enterprise app list merging"
  description: "Guards a new flow for recursive required enterprise app list merging"
  bug: "319084618"
  bug: "319084618"
}
}

flag {
  name: "headless_device_owner_delegate_security_logging_bug_fix"
  namespace: "enterprise"
  description: "Fix delegate security logging for single user headless DO."
  bug: "289515470"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}
+7 −1
Original line number Original line Diff line number Diff line
@@ -9030,8 +9030,14 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
    void sendDeviceOwnerOrProfileOwnerCommand(String action, Bundle extras, int userId) {
    void sendDeviceOwnerOrProfileOwnerCommand(String action, Bundle extras, int userId) {
        if (userId == UserHandle.USER_ALL) {
        if (userId == UserHandle.USER_ALL) {
            if (Flags.headlessDeviceOwnerDelegateSecurityLoggingBugFix()
                    && getHeadlessDeviceOwnerModeForDeviceOwner()
                    == HEADLESS_DEVICE_OWNER_MODE_SINGLE_USER) {
                userId = mOwners.getDeviceOwnerUserId();
            } else {
                userId = UserHandle.USER_SYSTEM;
                userId = UserHandle.USER_SYSTEM;
            }
            }
        }
        boolean inForeground = false;
        boolean inForeground = false;
        ComponentName receiverComponent = null;
        ComponentName receiverComponent = null;
        if (action.equals(DeviceAdminReceiver.ACTION_NETWORK_LOGS_AVAILABLE)) {
        if (action.equals(DeviceAdminReceiver.ACTION_NETWORK_LOGS_AVAILABLE)) {