summaryrefslogtreecommitdiffstats
path: root/services/devicepolicy/java
diff options
context:
space:
mode:
authorEsteban Talavera <etalavera@google.com>2014-12-29 10:55:25 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-12-29 10:55:31 +0000
commitea84327fa48a33e3729c290ffe0862d86deb24a4 (patch)
treefcd82a9cfbb31ef4d98d412fee6d7744b4037414 /services/devicepolicy/java
parentd44222135e08d1d93bb866e60c10d2b70078179d (diff)
parent8add57224ffcf73705e507f1b73954e5de15eb88 (diff)
downloadframeworks_base-ea84327fa48a33e3729c290ffe0862d86deb24a4.zip
frameworks_base-ea84327fa48a33e3729c290ffe0862d86deb24a4.tar.gz
frameworks_base-ea84327fa48a33e3729c290ffe0862d86deb24a4.tar.bz2
Merge "Remove deprecated version of setProfileOwner that takes packageName"
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;