From a1db3cc833895803213b1dab55b917ad8ab0359f Mon Sep 17 00:00:00 2001 From: Tony Mak Date: Thu, 9 Jun 2016 14:32:11 +0100 Subject: findDeviceAdmin searchs for disable receiver as well Bug: 29210257 Change-Id: I378279d6df6c82da73f26ec551c35fa3d162cd79 --- src/com/android/managedprovisioning/common/Utils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/android/managedprovisioning/common/Utils.java b/src/com/android/managedprovisioning/common/Utils.java index 598f3b1f..a2a9d735 100644 --- a/src/com/android/managedprovisioning/common/Utils.java +++ b/src/com/android/managedprovisioning/common/Utils.java @@ -176,7 +176,7 @@ public class Utils { * If mdmComponentName is supplied (not null): * mdmPackageName is ignored. * Check that the package of mdmComponentName is installed, that mdmComponentName is a - * receiver in this package, and return it. + * receiver in this package, and return it. The receiver can be in disabled state. * * Otherwise: * mdmPackageName must be supplied (not null). @@ -196,7 +196,7 @@ public class Utils { PackageInfo pi; try { pi = c.getPackageManager().getPackageInfo(mdmPackageName, - PackageManager.GET_RECEIVERS); + PackageManager.GET_RECEIVERS | PackageManager.MATCH_DISABLED_COMPONENTS); } catch (NameNotFoundException e) { throw new IllegalProvisioningArgumentException("Mdm "+ mdmPackageName + " is not installed. ", e); -- cgit v1.2.3