diff options
| author | 2016-11-03 10:19:23 +0000 | |
|---|---|---|
| committer | 2016-11-03 10:36:48 +0000 | |
| commit | a27884236fe1eade93a124f00f0b843997b40a31 (patch) | |
| tree | 9212768627297c210ef0a1a3d4e2e8b3ce07a5e0 | |
| parent | 88dea2dd23e3df5f87826aa6e524233f37b17588 (diff) | |
Stop non-DO devices from disabling network logging
Bug: 32623860
Change-Id: Ia53ce842fffb2a15c16c9535fbe07421ae7f2578
| -rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index 6006c6bf6d3b..a156c4f968eb 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -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."); - } + setBackupServiceEnabledInternal(false); + Slog.w(LOG_TAG, "Security logging, network logging and backup service turned off as" + + " it's not a single user device."); } } |