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

Commit f8c04cbe authored by Suprabh Shukla's avatar Suprabh Shukla
Browse files

Enabling auto-ota in retail demo mode

Bug: 29542384
Change-Id: If7c94cf8a8e5851011f23dc5d64fc795f9a07b22
parent 9585012c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -8193,6 +8193,12 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {

    @Override
    public SystemUpdatePolicy getSystemUpdatePolicy() {
        if (UserManager.isDeviceInDemoMode(mContext)) {
            // Pretending to have an automatic update policy when the device is in retail demo
            // mode. This will allow the device to download and install an ota without
            // any user interaction.
            return SystemUpdatePolicy.createAutomaticInstallPolicy();
        }
        synchronized (this) {
            SystemUpdatePolicy policy =  mOwners.getSystemUpdatePolicy();
            if (policy != null && !policy.isValid()) {