Commit Graph

8 Commits

Author SHA1 Message Date
Philip P. Moltmann
bc054d8436 Rename RuntimePermissionPresenter to PermissionController
As this has already evolved from just presenting data. In the future any
permission related calls to the permission controller will be added here.

As the calls are protected by different permissions the binding will not
require a permission anymore, but each individual call checks the
permission.

Bug: 120221960
Test: Looked at settings UI showing data from this interface
Change-Id: I6b4a5c3b7ee17b145e11e2c1b6e11a8a232bffed
2019-01-03 11:39:43 -08:00
Philip P. Moltmann
22b8498815 Factor out service handling out of RuntimePermissionPresenter
Fixes: 121270006
Test: Looked at settings page that use RuntimePermissionPresenter
Change-Id: I3030511bce76fd0f30fac1ac922f6ff9f09ca80e
2018-12-19 13:40:17 -08:00
Philip P. Moltmann
08cac8e486 Add new method to count how many apps have permissions
Test: Called API and looked at result
Bug: 120221960
Change-Id: Icb8ee7f46849f26f4625b42e7b482c655409d175
2018-12-04 16:53:23 -08:00
Philip P. Moltmann
dbf78b8127 Move RuntimePermissionPresenter to android.permission
Consolidate all permission related code in a single java package.

Test: atest SettingsLibRoboTests
      Looked at Settings AppInfo UI (uses RuntimePermissionPresenter)
Bug: 120221960
Change-Id: If135e984a8273e9bed80cab9fbf2d70f40a05c7f
2018-12-04 16:53:23 -08:00
Philip P. Moltmann
e1b277a413 Have a map of background -> foreground permssions
This needs to be available before package manager service is ready,
hence set it as soon as possible.

In the future we should also allow access to this mapping from other
processes than the system server.

Test: Built
Change-Id: If4240e5522e175ea9b341e4951ce261f17bbaadc
2018-11-08 09:19:51 -08:00
Zimuzo
cc2932fd81 Grant split permission from config
Instead of defining split permissions in Java file, we now move them to XML allowing us define vendor specific split permissions.

Test: Activity recognition is split correctly and auto granted when below split targetSdk.
Bug: 111411340
Change-Id: Ia5b3f47b73c9feea924373268a4eee142f555091
2018-11-01 16:08:27 +00:00
Philip P. Moltmann
a3ba4d9861 Make PermissionManager use lists
... as requested per API review.

- Sets require iteration via iterators
- Sets are more expensive to construct
- The advantage of sets (faster .contains) is not used
- The system ensures uniqueness of the entires in the list

Test: Built
Bug: 116798569
Change-Id: I2c3b5c6801b78e0bf942073bde1e90299aee39f6
2018-10-11 08:16:16 -07:00
Philip P. Moltmann
039678e13f Add PermissionManager exposing SPLIT_PERMISSIONS
The Permission Controller app (a mainline module) needs to be able to
read the SPLIT_PERMISSIONS. Hence this array needs to be exposed at
least as system-api. We need to make sure that the PackageParser,
PackageManager and Permission Controller app agree on which permissions
are split, hence it is best to define them at a single location.

I think exposing the split permissions to developers is useless and
potentially confusing. The app should never request a permission that
was split. The app should just behave as if split permissions do not
exist. The Permission Controller / Package Manager deal with the
split permissions and add them when needed. Hence I don't think we
should expose this data to 3rd parties.

Bug: 110953302
Test: requested permissions
Change-Id: I6951c52979c89ee5c13a4a14da125e1a01f2e234
2018-09-25 13:48:11 -07:00