summaryrefslogtreecommitdiffstats
path: root/services/devicepolicy/java
diff options
context:
space:
mode:
authorZoltan Szatmary-Ban <szatmz@google.com>2014-11-21 15:21:03 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-11-21 15:21:07 +0000
commit08229e817ecb67b0c7ebbd6b5b9ce4aef1b38cc2 (patch)
tree477fb3372af89bc80d68277a13ea437e9ed76f9d /services/devicepolicy/java
parent07334334aab3863408325653ceccee47f9e1788d (diff)
parent26ac6a6fd0ef43803c6edd786c8f1fa715ae3cca (diff)
downloadframeworks_base-08229e817ecb67b0c7ebbd6b5b9ce4aef1b38cc2.zip
frameworks_base-08229e817ecb67b0c7ebbd6b5b9ce4aef1b38cc2.tar.gz
frameworks_base-08229e817ecb67b0c7ebbd6b5b9ce4aef1b38cc2.tar.bz2
Merge "Shutdown backup manager service when device owner is set" into lmp-mr1-dev
Diffstat (limited to 'services/devicepolicy/java')
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 3b0a511..b97f4f9 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -34,6 +34,7 @@ import android.app.admin.DeviceAdminReceiver;
import android.app.admin.DevicePolicyManager;
import android.app.admin.DevicePolicyManagerInternal;
import android.app.admin.IDevicePolicyManager;
+import android.app.backup.IBackupManager;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.ContentResolver;
@@ -3652,6 +3653,18 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
"Trying to set device owner but device owner is already set.");
}
+ // Shutting down backup manager service permanently.
+ long ident = Binder.clearCallingIdentity();
+ try {
+ IBackupManager ibm = IBackupManager.Stub.asInterface(
+ ServiceManager.getService(Context.BACKUP_SERVICE));
+ ibm.setBackupServiceActive(UserHandle.USER_OWNER, false);
+ } catch (RemoteException e) {
+ throw new IllegalStateException("Failed deactivating backup service.", e);
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
+
if (mDeviceOwner == null) {
// Device owner is not set and does not exist, set it.
mDeviceOwner = DeviceOwner.createWithDeviceOwner(packageName, ownerName);