diff options
author | Svetoslav <svetoslavganov@google.com> | 2015-07-13 17:37:32 -0700 |
---|---|---|
committer | Svetoslav <svetoslavganov@google.com> | 2015-07-13 17:46:50 -0700 |
commit | 8b24a1d30fa5d2b80b2b6a37454dcc1e67d0e79d (patch) | |
tree | b522301f186550d4342e4c12eb548026acca11c9 /services | |
parent | c09544bb88ada53494d4a955d0450a22985b4799 (diff) | |
download | frameworks_base-8b24a1d30fa5d2b80b2b6a37454dcc1e67d0e79d.zip frameworks_base-8b24a1d30fa5d2b80b2b6a37454dcc1e67d0e79d.tar.gz frameworks_base-8b24a1d30fa5d2b80b2b6a37454dcc1e67d0e79d.tar.bz2 |
Fix two grant default permissions edge cases.
1. When querying for components to which to grant default
permissions we are now getting disabled components as
well as we want such packages to get default pemrissions
on upgrade as disabled components may get reenabled.
2. When resolving activities to whose packages to grant default
permissions we skip the corss-profile and skip-profile filters
as they are set by device policy which should not affect
implicitly default permission grants. Policy has explicit
APIs for permission management.
bug:22405963
Change-Id: Idf56d35e567a6fd6e097cd45988d1561422ee6fc
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java | 12 | ||||
-rw-r--r-- | services/core/java/com/android/server/pm/PackageManagerService.java | 1 |
2 files changed, 7 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java b/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java index 7a74729..ce4d42e 100644 --- a/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java +++ b/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java @@ -29,6 +29,7 @@ import android.content.pm.ProviderInfo; import android.content.pm.ResolveInfo; import android.net.Uri; import android.os.Build; +import android.os.Debug; import android.os.UserHandle; import android.provider.CalendarContract; import android.provider.ContactsContract; @@ -344,7 +345,6 @@ final class DefaultPermissionGrantPolicy { Intent cbrIntent = new Intent(Intents.SMS_CB_RECEIVED_ACTION); PackageParser.Package cbrPackage = getDefaultSystemHandlerActivityPackageLPr(cbrIntent, userId); - if (cbrPackage != null && doesPackageSupportRuntimePermissions(cbrPackage)) { grantRuntimePermissionsLPw(cbrPackage, SMS_PERMISSIONS, false, userId); } @@ -625,8 +625,9 @@ final class DefaultPermissionGrantPolicy { private PackageParser.Package getDefaultSystemHandlerActivityPackageLPr( Intent intent, int userId) { - List<ResolveInfo> handlers = mService.queryIntentActivities(intent, - intent.resolveType(mService.mContext.getContentResolver()), 0, userId); + List<ResolveInfo> handlers = mService.mActivities.queryIntent(intent, + intent.resolveType(mService.mContext.getContentResolver()), + PackageManager.GET_DISABLED_COMPONENTS, userId); final int handlerCount = handlers.size(); for (int i = 0; i < handlerCount; i++) { ResolveInfo handler = handlers.get(i); @@ -650,8 +651,9 @@ final class DefaultPermissionGrantPolicy { for (String syncAdapterPackageName : syncAdapterPackageNames) { homeIntent.setPackage(syncAdapterPackageName); - List<ResolveInfo> homeActivities = mService.queryIntentActivities(homeIntent, - homeIntent.resolveType(mService.mContext.getContentResolver()), 0, userId); + List<ResolveInfo> homeActivities = mService.mActivities.queryIntent(homeIntent, + homeIntent.resolveType(mService.mContext.getContentResolver()), + PackageManager.GET_DISABLED_COMPONENTS, userId); if (!homeActivities.isEmpty()) { continue; } diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 13aca79..fdc1ff0 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -146,7 +146,6 @@ import android.net.Uri; import android.os.Binder; import android.os.Build; import android.os.Bundle; -import android.os.Debug; import android.os.Environment; import android.os.Environment.UserEnvironment; import android.os.FileUtils; |