OSDN Git Service

Make isUsingUnifiedPassword throw when used on parent instance
authorPavel Grafov <pgrafov@google.com>
Mon, 18 Dec 2017 18:02:47 +0000 (18:02 +0000)
committerPavel Grafov <pgrafov@google.com>
Mon, 18 Dec 2017 18:29:51 +0000 (18:29 +0000)
It doesn't make sense to call it via parent instance.

Bug: 70788883
Test: cts-tradefed run cts -m DevicePolicyManager -t com.android.cts.devicepolicy.ManagedProfileTest#testParentProfileApiDisabled
Change-Id: I66334757ca8e9ee2525dbe88c83216563837aee6

core/java/android/app/admin/DevicePolicyManager.java

index 89df421..4bb4c50 100644 (file)
@@ -2676,6 +2676,7 @@ public class DevicePolicyManager {
      * @see UserManager#DISALLOW_UNIFIED_PASSWORD
      */
     public boolean isUsingUnifiedPassword(@NonNull ComponentName admin) {
+        throwIfParentInstance("isUsingUnifiedPassword");
         if (mService != null) {
             try {
                 return mService.isUsingUnifiedPassword(admin);