summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJulia Reynolds <juliacr@google.com>2015-05-13 20:14:41 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-05-13 20:14:44 +0000
commit396d944001f0b897b1689baa0bd7d3e04046b3ca (patch)
tree9af76b38f2c9c9a0c3032afb544f8aa379eec0fe /services
parentf5d758c006c278d166f22587f3deb9a63bdf4e4b (diff)
parent731051e36bb2d420a29cd889a38e02c88c930aad (diff)
downloadframeworks_base-396d944001f0b897b1689baa0bd7d3e04046b3ca.zip
frameworks_base-396d944001f0b897b1689baa0bd7d3e04046b3ca.tar.gz
frameworks_base-396d944001f0b897b1689baa0bd7d3e04046b3ca.tar.bz2
Merge "Remove initiator name param." into mnc-dev
Diffstat (limited to 'services')
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java20
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java7
2 files changed, 9 insertions, 18 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java b/services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java
index 88bf54e..d5b0804 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java
@@ -116,9 +116,9 @@ class DeviceOwner {
/**
* Creates an instance of the device owner object with the device initializer set.
*/
- static DeviceOwner createWithDeviceInitializer(ComponentName admin, String ownerName) {
+ static DeviceOwner createWithDeviceInitializer(ComponentName admin) {
DeviceOwner owner = new DeviceOwner();
- owner.mDeviceInitializer = new OwnerInfo(ownerName, admin);
+ owner.mDeviceInitializer = new OwnerInfo(null, admin);
return owner;
}
@@ -155,12 +155,8 @@ class DeviceOwner {
return mDeviceInitializer != null ? mDeviceInitializer.packageName : null;
}
- String getDeviceInitializerName() {
- return mDeviceInitializer != null ? mDeviceInitializer.name : null;
- }
-
- void setDeviceInitializer(ComponentName admin, String ownerName) {
- mDeviceInitializer = new OwnerInfo(ownerName, admin);
+ void setDeviceInitializer(ComponentName admin) {
+ mDeviceInitializer = new OwnerInfo(null, admin);
}
void clearDeviceInitializer() {
@@ -255,16 +251,15 @@ class DeviceOwner {
String packageName = parser.getAttributeValue(null, ATTR_PACKAGE);
mDeviceOwner = new OwnerInfo(name, packageName);
} else if (tag.equals(TAG_DEVICE_INITIALIZER)) {
- String name = parser.getAttributeValue(null, ATTR_NAME);
String packageName = parser.getAttributeValue(null, ATTR_PACKAGE);
String initializerComponentStr =
parser.getAttributeValue(null, ATTR_COMPONENT_NAME);
ComponentName admin =
ComponentName.unflattenFromString(initializerComponentStr);
if (admin != null) {
- mDeviceInitializer = new OwnerInfo(name, admin);
+ mDeviceInitializer = new OwnerInfo(null, admin);
} else {
- mDeviceInitializer = new OwnerInfo(name, packageName);
+ mDeviceInitializer = new OwnerInfo(null, packageName);
Slog.e(TAG, "Error parsing device-owner file. Bad component name " +
initializerComponentStr);
}
@@ -334,9 +329,6 @@ class DeviceOwner {
if (mDeviceInitializer != null) {
out.startTag(null, TAG_DEVICE_INITIALIZER);
out.attribute(null, ATTR_PACKAGE, mDeviceInitializer.packageName);
- if (mDeviceInitializer.name != null) {
- out.attribute(null, ATTR_NAME, mDeviceInitializer.name);
- }
if (mDeviceInitializer.admin != null) {
out.attribute(
null, ATTR_COMPONENT_NAME, mDeviceInitializer.admin.flattenToString());
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index ba5d666..675be0e 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -4122,8 +4122,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
}
@Override
- public boolean setDeviceInitializer(ComponentName who, ComponentName initializer,
- String ownerName) {
+ public boolean setDeviceInitializer(ComponentName who, ComponentName initializer) {
if (!mHasFeature) {
return false;
}
@@ -4142,10 +4141,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
if (mDeviceOwner == null) {
// Device owner state does not exist, create it.
- mDeviceOwner = DeviceOwner.createWithDeviceInitializer(initializer, ownerName);
+ mDeviceOwner = DeviceOwner.createWithDeviceInitializer(initializer);
} else {
// Device owner already exists, update it.
- mDeviceOwner.setDeviceInitializer(initializer, ownerName);
+ mDeviceOwner.setDeviceInitializer(initializer);
}
addDeviceInitializerToLockTaskPackagesLocked(UserHandle.USER_OWNER);