summaryrefslogtreecommitdiffstats
path: root/services/devicepolicy/java
diff options
context:
space:
mode:
authorEsteban Talavera <etalavera@google.com>2014-12-23 17:15:29 +0000
committerEsteban Talavera <etalavera@google.com>2014-12-24 09:38:13 +0000
commit8add57224ffcf73705e507f1b73954e5de15eb88 (patch)
tree0c097f1d4d8d7d19bf590bd49ad38f9da754b2af /services/devicepolicy/java
parent898de6fd8c78d84ae1425e052b27a97ec6f230ad (diff)
downloadframeworks_base-8add57224ffcf73705e507f1b73954e5de15eb88.zip
frameworks_base-8add57224ffcf73705e507f1b73954e5de15eb88.tar.gz
frameworks_base-8add57224ffcf73705e507f1b73954e5de15eb88.tar.bz2
Remove deprecated version of setProfileOwner that takes packageName
The ComponentName equivalent should be used instead. Bug: 17654371 Change-Id: I7001e86ab1709b824944148a3c44af5243dacb83
Diffstat (limited to 'services/devicepolicy/java')
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java39
1 files changed, 7 insertions, 32 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java b/services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java
index 9fd0e09..f0e02bc 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java
@@ -46,7 +46,7 @@ import java.util.Set;
* Stores and restores state for the Device and Profile owners. By definition there can be
* only one device owner, but there may be a profile owner for each user.
*/
-public class DeviceOwner {
+class DeviceOwner {
private static final String TAG = "DevicePolicyManagerService";
private static final String DEVICE_OWNER_XML = "device_owner.xml";
@@ -102,16 +102,6 @@ public class DeviceOwner {
}
/**
- * @deprecated Use a component name instead of package name
- * Creates an instance of the device owner object with the profile owner set.
- */
- static DeviceOwner createWithProfileOwner(String packageName, String ownerName, int userId) {
- DeviceOwner owner = new DeviceOwner();
- owner.mProfileOwners.put(userId, new OwnerInfo(ownerName, packageName));
- return owner;
- }
-
- /**
* Creates an instance of the device owner object with the profile owner set.
*/
static DeviceOwner createWithProfileOwner(ComponentName admin, String ownerName, int userId) {
@@ -136,13 +126,6 @@ public class DeviceOwner {
mDeviceOwner = null;
}
- /**
- * @deprecated
- */
- void setProfileOwner(String packageName, String ownerName, int userId) {
- mProfileOwners.put(userId, new OwnerInfo(ownerName, packageName));
- }
-
void setProfileOwner(ComponentName admin, String ownerName, int userId) {
mProfileOwners.put(userId, new OwnerInfo(ownerName, admin));
}
@@ -151,16 +134,6 @@ public class DeviceOwner {
mProfileOwners.remove(userId);
}
- /**
- * @deprecated Use getProfileOwnerComponent
- * @param userId
- * @return
- */
- String getProfileOwnerPackageName(int userId) {
- OwnerInfo profileOwner = mProfileOwners.get(userId);
- return profileOwner != null ? profileOwner.packageName : null;
- }
-
ComponentName getProfileOwnerComponent(int userId) {
OwnerInfo profileOwner = mProfileOwners.get(userId);
return profileOwner != null ? profileOwner.admin : null;
@@ -207,6 +180,7 @@ public class DeviceOwner {
return false;
}
+ @VisibleForTesting
void readOwnerFile() {
try {
InputStream input = openRead();
@@ -259,6 +233,7 @@ public class DeviceOwner {
}
}
+ @VisibleForTesting
void writeOwnerFile() {
synchronized (this) {
writeOwnerFileLocked();
@@ -329,10 +304,10 @@ public class DeviceOwner {
}
}
- static class OwnerInfo {
- public String name;
- public String packageName;
- public ComponentName admin;
+ private static class OwnerInfo {
+ public final String name;
+ public final String packageName;
+ public final ComponentName admin;
public OwnerInfo(String name, String packageName) {
this.name = name;