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

Commit 07a9c42c authored by Antoan Angelov's avatar Antoan Angelov Committed by Android (Google) Code Review
Browse files

Merge "Add UserRestrictionChanged atom and log to track user restriction events."

parents d41e8b49 d5db50ee
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -143,6 +143,7 @@ message Atom {
        BatteryCausedShutdown battery_caused_shutdown = 93;
        PhoneServiceStateChanged phone_service_state_changed = 94;
        PhoneStateChanged phone_state_changed = 95;
        UserRestrictionChanged user_restriction_changed = 96;
    }

    // Pulled events will start at field 10000.
@@ -3049,3 +3050,17 @@ message ProcessCpuTime {
    // Process cpu time in system space, cumulative from boot/process start
    optional int64 system_time_millis = 4;
}

/**
 * Logs when a user restriction was added or removed.
 *
 * Logged from:
 *   frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
 */
message UserRestrictionChanged {
    // The raw string of the user restriction as defined in UserManager.
    // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
    optional string restriction = 1;
    // Whether the restriction is enabled or disabled.
    optional bool enabled = 2;
}
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
@@ -206,6 +206,7 @@ import android.util.Log;
import android.util.Pair;
import android.util.Slog;
import android.util.SparseArray;
import android.util.StatsLog;
import android.util.Xml;
import android.view.IWindowManager;
import android.view.accessibility.AccessibilityManager;
@@ -9387,6 +9388,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
            }
            saveUserRestrictionsLocked(userHandle);
        }
        StatsLog.write(StatsLog.USER_RESTRICTION_CHANGED, key, enabledFromThisOwner);
        if (SecurityLog.isLoggingEnabled()) {
            final int eventTag = enabledFromThisOwner
                    ? SecurityLog.TAG_USER_RESTRICTION_ADDED