Add FLAG_PERMISSION_REVOKED_COMPAT.
We used to store the actual permission state for pre-M apps in app ops, which creates two different sources of permission state and is hard to handle correctly. This change will allow us to store the permission state for pre-M apps within permission as FLAG_PERMISSION_REVOKED_COMPAT (and syncing app op state based on it), and is part of the effort to support rollback of runtime permission state managed by PermissionController. Actually, we do set a REVOKE_ON_UPGRADE flag properly when user grants/revokes a runtime permission for pre-M apps, so it can be used for computing app op state. In the case where app ops are incorrectly set to denied without setting this flag, the app won't get the permission revoked upon upgrade to support runtime permissions, and is stuck with the denied app op, so overriding the app op state in this case is arguably fixing a bad state. Since the proposed new flag will cover whatever REVOKE_ON_UPGRADE does currently, and REVOKE_ON_UPGRADE did imply denying app op in its javadoc, this change is simply adding our new flag by renaming REVOKE_ON_UPGRADE. Bug: 136503238 Test: manual Change-Id: Ib910f4df543d2fd8de259a6675f043d870a6f4c1
Loading
Please register or sign in to comment