summaryrefslogtreecommitdiff
path: root/core/java/android/permission/PermissionUsageHelper.java
Commit message (Collapse)AuthorAgeFilesLines
* SystemUI: Allow toggling privacy indicators [1/2]Pranav Vashi2022-10-221-21/+21
| | | | | | | | | | **@semdoc add settings backup validators Co-authored-by: jhonboy121 <alfredmathew05@gmail.com> Co-authored-by: Ido Ben-Hur <idoybh2@gmail.com> Signed-off-by: Pranav Vashi <neobuddy89@gmail.com> Signed-off-by: Semavi Ulusoy <doc.divxm@gmail.com> Change-Id: I55fae9c85f69ebd72c60b11c2946c3bd94af10f5
* Note RECEIVE_AMBIENT_TRIGGER_AUDIO in the SoundTriggerNate Myren2022-05-091-0/+3
| | | | | | | | | | | | This op gets around the background restrictions on RECORD_AUDIO, when used for SoundTrigger detection In addition, moves the precise logic for soundtrigger RECORD_AUDIO checks out of the soundtrigger system Fixes: 230430779 Test: manual Change-Id: I6d63c99e2d31e3f668070ac82afed71ff6672c9e Merged-In: I6d63c99e2d31e3f668070ac82afed71ff6672c9e
* Location provider check for subattributionGanesh Olekar2022-03-171-1/+14
| | | | | | | Bug: 200280741 Test: atest com.android.systemui.privacy.PrivacyDialogTest Change-Id: I7240db08025d801eb537234ca95aeb17c3f302f2 Merged-In: I7240db08025d801eb537234ca95aeb17c3f302f2
* Add attribution to PermGroupUsage and indicatorsGanesh Olekar2022-02-171-17/+107
| | | | | | | Bug: 200280741 Test: atest com.android.systemui.privacy.PrivacyDialogTest Change-Id: I1dcd7bea997605f3caaac742419476f4e0ac2fdf CTS-Coverage-Bug: 220157796
* Ensure only microphone attribution chains are recordedNate Myren2021-12-291-5/+7
| | | | | | | | Also ensure each chain is attributed to only one op Test: manual Fixes: 212434116 Change-Id: I50efc2b305627f8e37eb28842487b911dce5d925
* Lock mAttributionChains in PermissionUsageHelperNate Myren2021-12-081-48/+58
| | | | | | Test: manual Fixes: 201451838 Change-Id: I4b17ed0e65fae45f393665f7f9d617a2acc1cbdd
* Only initialize PermissionUsageHelper lazily or when requestedNate Myren2021-11-021-0/+5
| | | | | | | | | This fixes a memory leak caused by automatically registering a PermissionUsageHelper on PermissionManager instantiation. Bug: 204222680 Test: manual Change-Id: I94c6da3dd89e8b158552e94c94e4d0fb3f5d6f0d
* Add attribution info to start callbacksNate Myren2021-08-031-12/+72
| | | | | | | | | | | Add attribution flags and chain IDs to start callbacks, and have the PermissionUsageHelper listen for starts. This ensures that, if another start happens while an op is already running, and has chain information, then this chain information will be recorded. Test: manual Bug: 194198234 Change-Id: I0ab1aa0969b70e18001f4a814ea5689f9329a019
* Create "trusted chain" mechanism for AttributionSourceNate Myren2021-06-301-1/+6
| | | | | | | | | Add and populate a "trusted" attribution flag, that verifies the attribution sources used to create it were trusted. Fixes: 192270935 Test: atest RuntimePermissionsAppOpTrackingTest Change-Id: Ifd8f825151bec55aa795da7bee0a3069509f5abe
* Create Attribution Chains in HistoricalOpsNate Myren2021-06-231-1/+3
| | | | | | | | | | Add a historical flag to signify that attribution chains should be assembled. Assemble the chains, filter out middle nodes, and attach the last visible node to the start as a proxy info Bug: 158792096 Test: manual Change-Id: I8fbd8f438c62b28fd90039440e86224c624dea79
* Support AttributionSource chains in PermissionUsageHelperNate Myren2021-06-041-4/+116
| | | | | | Test: manual Bug: 184963112 Change-Id: Idca4ccdaab1f243b754ef15888ea679788bfdd9b
* Exclude only system and device intelligence roles from indicatorsNate Myren2021-04-071-22/+5
| | | | | | | | | | | Converts both the AppOpsControllerImpl and the PermissionUsageHelper to use the same static method when filtering which packages to show. The only packages which are filtered are 6 device intelligence roles, and the system package. These values are updated at most every 15 seconds Fixes: 184141707 Test: manual Change-Id: I9dc44197a2ff3df7783b37f450ada4ef2fb1ca6f
* Assemble proxy chain based on package/uid, not attribution tagNate Myren2021-04-021-23/+25
| | | | | | | | | Some proxy usages, in future, may not have matching attribution tags. Match on package name and uid instead. Bug: 183402046 Test: Manual Change-Id: If122f13fb1d20bfe0bad415235f2143d41339650
* Merge "Add Permission Indicator methods/classes to Test Api" into sc-devNate Myren2021-03-241-5/+6
|\
| * Add Permission Indicator methods/classes to Test ApiNate Myren2021-03-231-5/+6
| | | | | | | | | | | | | | | | Also sets lastAccessTime = now for running ops Test: atest PermissionIndicatorAppOpUsageTest Bug: 172868375 Change-Id: I2a616f624640e0f219e33d6fa8ebf55559e24e1a
* | Handle proxy chains including the system packageNate Myren2021-03-221-18/+20
|/ | | | | | | | | | Ensure that usages with the system package are not filtered entirely. Instead, they should not be shown on their own, and the "system" label should not be included in proxy label chains Bug: 172868375 Test: manual Change-Id: If9812ce915de0ca1ac47d93d96f199a8bb768bce
* Remove R QPR attribution hacksNate Myren2021-03-161-430/+104
| | | | | | Bug: 172868375 Test: manual Change-Id: I5e731bb821e879f6c314604912f13800ca668aa4
* Show all system apps to hub teamfood, remove location indicatorNate Myren2021-03-121-5/+4
| | | | | | | | | | Location indicator has its own flag, so it is being removed from the hub teamfood. Also, showing all system usages (except the system app) for the hub teamfood. Bug: 172868375 Test: atest PrivacyDialogControllerTest, PrivacyItemControllerFlagsTest Change-Id: Iad5b141f600a0bf830d5b2ef5169ed90533914cb
* Show usage by default speech recognizerNate Myren2021-02-261-1/+13
| | | | | | Test: manual Fixes: 181067845 Change-Id: I9be50bf4bbafcedbc1c52adc0780b9821c865c8d
* Fix double adding of special attribution usageNate Myren2021-02-111-4/+5
| | | | | | Fixes: 180019623 Test: manual Change-Id: I6e0681e0126bc563d8af4cd11c7db0785e47c912
* Change recent threshold to 15 secondsNate Myren2021-01-291-1/+1
| | | | | | | | Change default recent threshold to 15 seconds Test: build Bug: 172868375 Change-Id: Ib716cc68744aa563fcf8988be6da56c9f95b9ab9
* Add wifi call special case, fix phone, predictor, filter systemNate Myren2021-01-281-6/+53
| | | | | | | | | | | | Add the wifi call special case, where if a call is ongoing while a carrier privileged app is using microphone, the phone call usage is removed. Ensure the phone mic op is listened for, add code to find the predictor app, and show it, if the user is in a teamfood. Filter the system app out, since the system app can be a location provider Fixes: 178701757 Test: Manual Change-Id: Ic1bf7f28c99bc0f596492332f7b4656c3bd7d25e
* Make sure user context map is ArrayMap, not MapNate Myren2021-01-271-6/+5
| | | | | | | | Ensure the user context map is editable, and remove hardcoded enable. Fixes: 178616169 Test: manual Change-Id: I54d721be7712a2efcc3695bae5ae7e44920a40ed
* Do not look at self when comparing for duplicate usageNate Myren2021-01-211-0/+5
| | | | | | | | When looking for duplicate usages, do not compare to self Fixes: 178088373 Test: manual Change-Id: I5e7316caff5ff33017cd868324c066a3f3e99bd6
* Fix proxy attribution in PermissionUsageHelperNate Myren2021-01-151-50/+88
| | | | | | Test: manual Fixes: 177677430 Change-Id: I98e65447ee33e2c15785e7f1ef0c003bbc4d9540
* Add special attribution cases to PermissionUsageHelperNate Myren2021-01-131-39/+332
| | | | | | | | | Porting the proxy usage and mic special attribution cases from the PermissionController to the PermissionManager Bug: 172868375 Test: manual Change-Id: I2af850c9cd709541abf862377b67153a1c477c94
* Merge "Add lastAccessTime to PermGroupUsage"Nate Myren2021-01-111-1/+1
|\
| * Add lastAccessTime to PermGroupUsageNate Myren2021-01-111-1/+1
| | | | | | | | | | | | Bug: 172868375 Test: Build Change-Id: Ib23ef6459f709a2743e9e662619cb785a1ce54c7
* | Merge "Check for running app op when checking recent"TreeHugger Robot2021-01-091-1/+1
|\ \
| * | Check for running app op when checking recentNate Myren2021-01-081-1/+1
| |/ | | | | | | | | | | | | | | | | Ensure that it is checked if an app op is running before filtering it due to an old "lastAccessTime". Fixes: 177089983 Test: manual Change-Id: Ibeb344ad691994a93bde1a93794093d7d4fc920c
* / Create copy of op list, return empty if indicators disabledNate Myren2021-01-071-3/+4
|/ | | | | | | | | | When assembling the op list, create a copy, do not use the existing camera op list, as that list is final. Also return an empty list when indicators are disabled, not null. Fixes: 177005228 Test: Manual Change-Id: I281085c12f0706836098fc2f16d196887596170e
* Add most basic aspects of permission usage to PermissionManagerNate Myren2020-12-161-0/+441
Add the basic API for getting permission usage for mic, camera, and location. Does not use special attribution yet. Mostly untested Bug: 172868375 Test: Basic manual tests Change-Id: Icb268b820557d62125e9307d6ffcf7046ab9b490