diff options
author | Svet Ganov <svetoslavganov@google.com> | 2015-08-11 08:59:12 -0700 |
---|---|---|
committer | Svet Ganov <svetoslavganov@google.com> | 2015-08-12 21:57:59 -0700 |
commit | 52153f4c0540a991b5b7214f4f14b5a891479a3c (patch) | |
tree | 934aee2bfdd5307c01434c2ab18e15cb8b66dbd1 /services | |
parent | ff9912d594bc5cdc10a4a224b9a2296bac50851b (diff) | |
download | frameworks_base-52153f4c0540a991b5b7214f4f14b5a891479a3c.zip frameworks_base-52153f4c0540a991b5b7214f4f14b5a891479a3c.tar.gz frameworks_base-52153f4c0540a991b5b7214f4f14b5a891479a3c.tar.bz2 |
Add GTS test to ensure valid default permission grants - framework
The platform grants runtime permissions by default to apps on the
system image that provide core device use cases which a user expects
to work out-of-the-box. We are now adding a test to ensure that
OEMs cannot pregrant premissions on non approved components.
bug:23043018
Change-Id: Id76717cce0ee59678956bd0be347d3c045fe4c51
Diffstat (limited to 'services')
3 files changed, 4 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/content/ContentService.java b/services/core/java/com/android/server/content/ContentService.java index c13401f..b766894 100644 --- a/services/core/java/com/android/server/content/ContentService.java +++ b/services/core/java/com/android/server/content/ContentService.java @@ -157,7 +157,7 @@ public final class ContentService extends IContentService.Stub { mFactoryTest = factoryTest; // Let the package manager query for the sync adapters for a given authority - // as we grant default permissions to sync adapters for specifix authorities. + // as we grant default permissions to sync adapters for specific authorities. PackageManagerInternal packageManagerInternal = LocalServices.getService( PackageManagerInternal.class); packageManagerInternal.setSyncAdapterPackagesprovider( diff --git a/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java b/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java index 71a2d59..d2a70df 100644 --- a/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java +++ b/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java @@ -296,7 +296,7 @@ final class DefaultPermissionGrantPolicy { PackageParser.Package storagePackage = getDefaultProviderAuthorityPackageLPr( "com.android.externalstorage.documents", userId); if (storagePackage != null) { - grantRuntimePermissionsLPw(storagePackage, STORAGE_PERMISSIONS, userId); + grantRuntimePermissionsLPw(storagePackage, STORAGE_PERMISSIONS, true, userId); } // CertInstaller @@ -360,7 +360,7 @@ final class DefaultPermissionGrantPolicy { PackageParser.Package cbrPackage = getDefaultSystemHandlerActivityPackageLPr(cbrIntent, userId); if (cbrPackage != null && doesPackageSupportRuntimePermissions(cbrPackage)) { - grantRuntimePermissionsLPw(cbrPackage, SMS_PERMISSIONS, false, userId); + grantRuntimePermissionsLPw(cbrPackage, SMS_PERMISSIONS, userId); } // Calendar diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java index 00d0fe1..7dc04de 100644 --- a/services/core/java/com/android/server/pm/Settings.java +++ b/services/core/java/com/android/server/pm/Settings.java @@ -4151,7 +4151,7 @@ final class Settings { pw.print(", COSTS_MONEY"); } if ((perm.info.flags&PermissionInfo.FLAG_HIDDEN) != 0) { - pw.print(", COSTS_HIDDEN"); + pw.print(", HIDDEN"); } if ((perm.info.flags&PermissionInfo.FLAG_INSTALLED) != 0) { pw.print(", INSTALLED"); |