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

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

Merge "Fix unit test: set sysprop via injector" into main

parents 52f5c3a0 f5844c8a
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -15834,11 +15834,11 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
    }
    private void enforceLoggingPolicy(
            boolean securityLoggingEnabled, boolean auditLoggingEnabled) {
            boolean securityLogEnabled, boolean auditLogEnabled) {
        Slogf.i(LOG_TAG, "Enforcing logging policy, security: %b audit: %b",
                securityLoggingEnabled, auditLoggingEnabled);
        SecurityLog.setLoggingEnabledProperty(securityLoggingEnabled || auditLoggingEnabled);
        setLoggingConfiguration(securityLoggingEnabled, auditLoggingEnabled);
                securityLogEnabled, auditLogEnabled);
        mInjector.securityLogSetLoggingEnabledProperty(securityLogEnabled || auditLogEnabled);
        setLoggingConfiguration(securityLogEnabled, auditLogEnabled);
    }
    private void setLoggingConfiguration(
+25 −28
Original line number Diff line number Diff line
@@ -469,15 +469,16 @@ class SecurityLogMonitor implements Runnable {
        }

        if (!securityLogV2Enabled() || mLegacyLogEnabled) {
            addToLegacyBuffer(dedupedLogs);
            addToLegacyBufferLocked(dedupedLogs);
        }

        if (securityLogV2Enabled() && mAuditLogEnabled) {
            addAuditLogEvents(dedupedLogs);
            addAuditLogEventsLocked(dedupedLogs);
        }
    }

    private void addToLegacyBuffer(List<SecurityEvent> dedupedLogs) {
    @GuardedBy("mLock")
    private void addToLegacyBufferLocked(List<SecurityEvent> dedupedLogs) {
        // Save the rest of the new batch.
        mPendingLogs.addAll(dedupedLogs);

@@ -649,9 +650,8 @@ class SecurityLogMonitor implements Runnable {
        Slogf.i(TAG, "Set audit log callback for UID %d", uid);
    }

    private void addAuditLogEvents(List<SecurityEvent> events) {
        mLock.lock();
        try {
    @GuardedBy("mLock")
    private void addAuditLogEventsLocked(List<SecurityEvent> events) {
        if (mPaused) {
            // TODO: maybe we need to stash the logs in some temp buffer wile paused so that
            // they can be accessed after affiliation is fixed.
@@ -673,9 +673,6 @@ class SecurityLogMonitor implements Runnable {
            Slogf.d(TAG, "Audit event buffer size after trimming: %d",
                    mAuditLogEventBuffer.size());
        }
        } finally {
            mLock.unlock();
        }
    }

    @GuardedBy("mLock")