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

Commit a2788423 authored by Michal Karpinski's avatar Michal Karpinski
Browse files

Stop non-DO devices from disabling network logging

Bug: 32623860
Change-Id: Ia53ce842fffb2a15c16c9535fbe07421ae7f2578
parent 88dea2dd
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -9107,20 +9107,19 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
    }

    private synchronized void disableDeviceOwnerManagedSingleUserFeaturesIfNeeded() {
        if (!mOwners.hasDeviceOwner()) {
            return;
        }
        if (!isDeviceOwnerManagedSingleUserDevice()) {
            mInjector.securityLogSetLoggingEnabledProperty(false);
            Slog.w(LOG_TAG, "Security logging turned off as it's no longer a single user device.");

            getDeviceOwnerAdminLocked().isNetworkLoggingEnabled = false;
            saveSettingsLocked(mInjector.userHandleGetCallingUserId());
            setNetworkLoggingActiveInternal(false);
            Slog.w(LOG_TAG, "Network logging turned off as it's no longer a single user"
                    + " device.");

            if (mOwners.hasDeviceOwner()) {
            setBackupServiceEnabledInternal(false);
                Slog.w(LOG_TAG, "Backup is off as it's a managed device that has more that one user.");
            }
            Slog.w(LOG_TAG, "Security logging, network logging and backup service turned off as"
                    + " it's not a single user device.");
        }
    }