diff options
author | Julia Reynolds <juliacr@google.com> | 2015-05-11 15:52:08 -0400 |
---|---|---|
committer | Julia Reynolds <juliacr@google.com> | 2015-05-11 16:41:20 -0400 |
commit | 731051e36bb2d420a29cd889a38e02c88c930aad (patch) | |
tree | 543dbfdb3fffa537c9c7219c9bc4b4e8077dd16d | |
parent | faf55219877416c1bdfbdfe5b7d24e35e9971a03 (diff) | |
download | frameworks_base-731051e36bb2d420a29cd889a38e02c88c930aad.zip frameworks_base-731051e36bb2d420a29cd889a38e02c88c930aad.tar.gz frameworks_base-731051e36bb2d420a29cd889a38e02c88c930aad.tar.bz2 |
Remove initiator name param.
This won't be shown in the UI; it's not needed.
Bug: 20820224
Change-Id: I51ecd0a9151a49e26faf52e792a0b316a8facc8e
6 files changed, 15 insertions, 25 deletions
diff --git a/api/current.txt b/api/current.txt index e9e2d04..595a43d 100644 --- a/api/current.txt +++ b/api/current.txt @@ -5747,7 +5747,7 @@ package android.app.admin { method public void setCameraDisabled(android.content.ComponentName, boolean); method public void setCertInstallerPackage(android.content.ComponentName, java.lang.String) throws java.lang.SecurityException; method public void setCrossProfileCallerIdDisabled(android.content.ComponentName, boolean); - method public boolean setDeviceInitializer(android.content.ComponentName, android.content.ComponentName, java.lang.String) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException; + method public boolean setDeviceInitializer(android.content.ComponentName, android.content.ComponentName) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException; method public void setGlobalSetting(android.content.ComponentName, java.lang.String, java.lang.String); method public boolean setKeyguardDisabled(android.content.ComponentName, boolean); method public void setKeyguardDisabledFeatures(android.content.ComponentName, int); diff --git a/api/system-current.txt b/api/system-current.txt index 5ff1b99..7e59aaa 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -5853,7 +5853,7 @@ package android.app.admin { method public void setCameraDisabled(android.content.ComponentName, boolean); method public void setCertInstallerPackage(android.content.ComponentName, java.lang.String) throws java.lang.SecurityException; method public void setCrossProfileCallerIdDisabled(android.content.ComponentName, boolean); - method public boolean setDeviceInitializer(android.content.ComponentName, android.content.ComponentName, java.lang.String) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException; + method public boolean setDeviceInitializer(android.content.ComponentName, android.content.ComponentName) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException; method public void setGlobalSetting(android.content.ComponentName, java.lang.String, java.lang.String); method public boolean setKeyguardDisabled(android.content.ComponentName, boolean); method public void setKeyguardDisabledFeatures(android.content.ComponentName, int); diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index ae07206..47201fe 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -2793,17 +2793,16 @@ public class DevicePolicyManager { * @param who Which {@link DeviceAdminReceiver} this request is associated with, or null if not * called by the device owner. * @param initializer Which {@link DeviceAdminReceiver} to make device initializer. - * @param initializerName The user-visible name of the device initializer. * @return whether the component was successfully registered as the device initializer. * @throws IllegalArgumentException if the componentname is null or invalid * @throws IllegalStateException if the caller is not device owner or the device has * already been provisioned or a device initializer already exists. */ - public boolean setDeviceInitializer(ComponentName who, ComponentName initializer, - String initializerName) throws IllegalArgumentException, IllegalStateException { + public boolean setDeviceInitializer(ComponentName who, ComponentName initializer) + throws IllegalArgumentException, IllegalStateException { if (mService != null) { try { - return mService.setDeviceInitializer(who, initializer, initializerName); + return mService.setDeviceInitializer(who, initializer); } catch (RemoteException re) { Log.w(TAG, "Failed to set device initializer"); } diff --git a/core/java/android/app/admin/IDevicePolicyManager.aidl b/core/java/android/app/admin/IDevicePolicyManager.aidl index e81e7c1..7385073 100644 --- a/core/java/android/app/admin/IDevicePolicyManager.aidl +++ b/core/java/android/app/admin/IDevicePolicyManager.aidl @@ -212,7 +212,7 @@ interface IDevicePolicyManager { boolean setUserEnabled(in ComponentName who); boolean isDeviceInitializer(String packageName); void clearDeviceInitializer(in ComponentName who); - boolean setDeviceInitializer(in ComponentName who, in ComponentName initializer, String initializerName); + boolean setDeviceInitializer(in ComponentName who, in ComponentName initializer); String getDeviceInitializer(); ComponentName getDeviceInitializerComponent(); diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java b/services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java index 28ffc57..767ebaf 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java @@ -115,9 +115,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; } @@ -154,12 +154,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() { @@ -254,16 +250,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); } @@ -333,9 +328,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 67c198f..a64f54a 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -4121,8 +4121,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; } @@ -4141,10 +4140,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); |