Fixing NPE in device policy tests

Bug: 30224255
Change-Id: I5c21f8d0e5660cca1cf7861649195672348f802c
This commit is contained in:
Ashley Smith
2016-08-05 11:24:02 -04:00
parent 31cde3cd69
commit 68a2a0feed

View File

@@ -5874,8 +5874,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
updateDeviceOwnerLocked();
disableSecurityLoggingIfNotCompliant();
try {
// Reactivate backup service.
mInjector.getIBackupManager().setBackupServiceActive(UserHandle.USER_SYSTEM, true);
if (mInjector.getIBackupManager() != null) {
// Reactivate backup service.
mInjector.getIBackupManager().setBackupServiceActive(UserHandle.USER_SYSTEM, true);
}
} catch (RemoteException e) {
throw new IllegalStateException("Failed reactivating backup service.", e);
}