Stop non-DO devices from disabling network logging

Bug: 32623860
Change-Id: Ia53ce842fffb2a15c16c9535fbe07421ae7f2578
This commit is contained in:
Michal Karpinski
2016-11-03 10:19:23 +00:00
parent 88dea2dd23
commit a27884236f

View File

@@ -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.");
}
}