Don't re-prompt VISUAL/AURAL after app upgrade #2
Background/Motivation: When a targetSDK=S-or-lesser app on a T+ platform has the STORAGE permission group granted, the READ_MEDIA_AURAL and READ_MEDIA_VISUAL permissions (due to split permission definitions) will be implicitly granted to the app. When the app is upgraded to targetSDK=T+, the split permission no longer applies, and so it will need to request the READ_MEDIA_AURAL and READ_MEDIA_VISUAL permissions explicitly. And, due to current split permission handling logic, when this upgrade occurs, the app will require a grant dialog re-prompt to be granted these new permissions. But, for READ_MEDIA_AURAL and READ_MEDIA_VISUAL, we don't want to re-prompt. Why re-prompt occurs: The reason the re-prompt occurs is that, upon app-upgrade, implicitly- granted permissions (such as split permissions) are assigned the REVOKE_WHEN_REQUESTED flag. The purpose of setting this flag for split permissions is that usually we want to perform exactly the opposite of the motive for this commit: the flag in fact forces formerly-implicit, now-explicit permissions to result in a grant dialog re- prompt. Solution: The solution is to simply not set this flag for these specific permissions. (Also: in this commit, to make things less confusing, we changed the STORAGE list to only include permissions in the STORAGE group. This required updating an if statement unrelated to this change.) Bug: 228609860 Test: manual Change-Id: I6122ddddff16ca2b3f04a49670960c00a93a0ed5
Loading
Please register or sign in to comment