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

Commit 9f879690 authored by Rubin Xu's avatar Rubin Xu Committed by Android (Google) Code Review
Browse files

Merge "Reactivate backup service after device owner is cleared."

parents 8510b79b ed969e18
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -4236,6 +4236,17 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                mDeviceOwner.clearDeviceOwner();
                mDeviceOwner.writeOwnerFile();
                updateDeviceOwnerLocked();
                // Reactivate backup service.
                long ident = Binder.clearCallingIdentity();
                try {
                    IBackupManager ibm = IBackupManager.Stub.asInterface(
                            ServiceManager.getService(Context.BACKUP_SERVICE));
                    ibm.setBackupServiceActive(UserHandle.USER_OWNER, true);
                } catch (RemoteException e) {
                    throw new IllegalStateException("Failed reactivating backup service.", e);
                } finally {
                    Binder.restoreCallingIdentity(ident);
                }
            }
        }
    }