diff options
-rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java | 20 | ||||
-rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | 4 |
2 files changed, 23 insertions, 1 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java b/services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java index f0e02bc..57ed876 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DeviceOwner.java @@ -39,7 +39,9 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.io.PrintWriter; import java.util.HashMap; +import java.util.Map; import java.util.Set; /** @@ -320,5 +322,23 @@ class DeviceOwner { this.admin = admin; this.packageName = admin.getPackageName(); } + public void dump(String prefix, PrintWriter pw) { + pw.println(prefix + "admin=" + admin); + pw.println(prefix + "name=" + name); + pw.println(); + } + } + + public void dump(String prefix, PrintWriter pw) { + if (mDeviceOwner != null) { + pw.println(prefix + "Device Owner: "); + mDeviceOwner.dump(prefix + " ", pw); + } + if (mProfileOwners != null) { + for (Map.Entry<Integer, OwnerInfo> entry : mProfileOwners.entrySet()) { + pw.println(prefix + "Profile Owner (User " + entry.getKey() + "): "); + entry.getValue().dump(prefix + " ", pw); + } + } } } diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index 8170835..770da5b 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -4139,7 +4139,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { synchronized (this) { p.println("Current Device Policy Manager state:"); - + if (mDeviceOwner != null) { + mDeviceOwner.dump(" ", pw); + } int userCount = mUserData.size(); for (int u = 0; u < userCount; u++) { DevicePolicyData policy = getUserData(mUserData.keyAt(u)); |