Revert "Fix backup for users hit by erroneous backup disabling"

BUG=31754835
This reverts commit 1975021d88.

Change-Id: I5cf7862126755a34cf3b4d70436529401fddc87f
This commit is contained in:
Vladislav Kuzkokov
2016-10-05 12:43:33 +00:00
parent 1975021d88
commit 9f61d17e6a

View File

@@ -496,12 +496,6 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
}
});
}
// STOPSHIP: Remove this code once all dogfood devices are fixed. See b/31754835
if (Intent.ACTION_BOOT_COMPLETED.equals(action) && !mOwners.hasDeviceOwner()
&& !isBackupServiceEnabledInternal()) {
setBackupServiceEnabledInternal(true);
Slog.w(LOG_TAG, "Fix backup for device that is not in Device Owner mode.");
}
if (Intent.ACTION_USER_UNLOCKED.equals(action)
|| Intent.ACTION_USER_STARTED.equals(action)
|| KeyChain.ACTION_STORAGE_CHANGED.equals(action)) {
@@ -9323,15 +9317,12 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
}
synchronized (this) {
getActiveAdminForCallerLocked(admin, DeviceAdminInfo.USES_POLICY_DEVICE_OWNER);
return isBackupServiceEnabledInternal();
}
}
private boolean isBackupServiceEnabledInternal() {
try {
IBackupManager ibm = mInjector.getIBackupManager();
return ibm != null && ibm.isBackupServiceActive(UserHandle.USER_SYSTEM);
} catch (RemoteException e) {
throw new IllegalStateException("Failed requesting backup service state.", e);
try {
IBackupManager ibm = mInjector.getIBackupManager();
return ibm != null && ibm.isBackupServiceActive(UserHandle.USER_SYSTEM);
} catch (RemoteException e) {
throw new IllegalStateException("Failed requesting backup service state.", e);
}
}
}
}