Add process capability as a new dimension.
Add new attribute capability to ProcessRecord, it represents what this process is allowed to do. Capability is a separate dimension for process state (ProcState). In OomAdjuster.java, capabilities can be passed from client to service. Add PROCESS_CAPABILITY_FOREGROUND_LOCATION to represent the capability that can access location while-in-use. For permission such as foreground location access, AppOpsService checks for FOREGROUND_LOCATION capability, also checks if the process is in one of the foreground process states, if both conditions meet, the locaton operation is allowed. Remove PROCESS_STATE_FOREGROUND_SERVICE_LOCATION. Bug: 136274596 Test: atest CtsAppTestCases:ActivityManagerProcessStateTest atest CtsAppTestCases:ActivityManagerApi29Test atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/appop/AppOpsServiceTest.java Change-Id: Ie1c8e670fb0789208b753eb49b7e2fce6a2f211f
Loading
Please register or sign in to comment