diff options
author | Nicolas Prevot <nprevot@google.com> | 2015-02-11 14:27:47 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-02-11 14:27:49 +0000 |
commit | 8b0c8ffb2d921ce5c90bcaaa3f1182d531d90d2c (patch) | |
tree | aba0441ab1561741694f6b0ceb1a8f299d22bd67 /services/devicepolicy | |
parent | 97a366f9d7d7a089195794b86e78fee782828607 (diff) | |
parent | 0413046f12316f36d12e91ba6dbafc53a7c20408 (diff) | |
download | frameworks_base-8b0c8ffb2d921ce5c90bcaaa3f1182d531d90d2c.zip frameworks_base-8b0c8ffb2d921ce5c90bcaaa3f1182d531d90d2c.tar.gz frameworks_base-8b0c8ffb2d921ce5c90bcaaa3f1182d531d90d2c.tar.bz2 |
Merge "Dont throw an exception for non-system apps when enabling system apps."
Diffstat (limited to 'services/devicepolicy')
-rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index b8f0d07..05c37d1 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -5045,15 +5045,14 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { if (activitiesToEnable != null) { for (ResolveInfo info : activitiesToEnable) { if (info.activityInfo != null) { - - if (!isSystemApp(pm, info.activityInfo.packageName, primaryUser.id)) { - throw new IllegalArgumentException( - "Only system apps can be enabled this way."); + String packageName = info.activityInfo.packageName; + if (isSystemApp(pm, packageName, primaryUser.id)) { + numberOfAppsInstalled++; + pm.installExistingPackageAsUser(packageName, userId); + } else { + Slog.d(LOG_TAG, "Not enabling " + packageName + " since is not a" + + " system app"); } - - - numberOfAppsInstalled++; - pm.installExistingPackageAsUser(info.activityInfo.packageName, userId); } } } |