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

Commit fc35f820 authored by Alex Johnston's avatar Alex Johnston
Browse files

Disable security and network logging COPE

* When the COPE work profile is removed, security
  and network logging should be stopped and removed.

Manual testing
* Set up device in COPE mode
* Enable network logging and security logging
  using TestDPC
* Add debugger breakpoint in DPMS.wipeData
* Select 'Remove work profile' in TestDPC
* Verify DPMS SecurityLogMonitor has been stopped
* Verify DPMS NetworkLogger is null

Bug: 182453624
Test: manual testing
Change-Id: I62df832023f12620e936b49240ecdb1cc2a722f5
parent 6309cca5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -869,6 +869,12 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
                synchronized (getLockObject()) {
                    // Check whether the user is affiliated, *before* removing its data.
                    boolean isRemovedUserAffiliated = isUserAffiliatedWithDeviceLocked(userHandle);
                    if (isProfileOwnerOfOrganizationOwnedDevice(userHandle)) {
                        // Disable network and security logging
                        mInjector.securityLogSetLoggingEnabledProperty(false);
                        mSecurityLogMonitor.stop();
                        setNetworkLoggingActiveInternal(false);
                    }
                    removeUserData(userHandle);
                    if (!isRemovedUserAffiliated) {
                        // We discard the logs when unaffiliated users are deleted (so that the