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

Commit 543befb7 authored by Vladislav Kuzkokov's avatar Vladislav Kuzkokov
Browse files

resolve merge conflicts of 792e051a to master

Change-Id: I75e604639959df77ddf11bbb9805392e4141da23
parents 85730569 792e051a
Loading
Loading
Loading
Loading
+7 −16
Original line number Diff line number Diff line
@@ -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_TRUST_STORE_CHANGED.equals(action)) {
@@ -9357,18 +9351,15 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
            return true;
        }
        synchronized (this) {
            getActiveAdminForCallerLocked(admin, DeviceAdminInfo.USES_POLICY_DEVICE_OWNER);
            return isBackupServiceEnabledInternal();
        }
    }
    private boolean isBackupServiceEnabledInternal() {
            try {
                getActiveAdminForCallerLocked(admin, DeviceAdminInfo.USES_POLICY_DEVICE_OWNER);
                IBackupManager ibm = mInjector.getIBackupManager();
                return ibm != null && ibm.isBackupServiceActive(UserHandle.USER_SYSTEM);
            } catch (RemoteException e) {
                throw new IllegalStateException("Failed requesting backup service state.", e);
            }
        }
    }

    /**
     * Return true if a given user has any accounts that'll prevent installing a device or profile