Add comment for not listening EXTERNAL_APPLICATIONS_UNAVAILABLE

Bug: 192653840
Test: only add comment.
Change-Id: I5a61ea76a40cf74e15ec36e415d6d4eb8ef6016f
This commit is contained in:
paulhu
2021-09-15 15:06:59 +08:00
committed by Paul Hu
parent 0ee7406d33
commit e7e02d7880

View File

@@ -222,6 +222,10 @@ public class PermissionMonitor {
mIntentReceiver, intentFilter, null /* broadcastPermission */, mIntentReceiver, intentFilter, null /* broadcastPermission */,
null /* scheduler */); null /* scheduler */);
// Listen to EXTERNAL_APPLICATIONS_AVAILABLE is that an app becoming available means it may
// need to gain a permission. But an app that becomes unavailable can neither gain nor lose
// permissions on that account, it just can no longer run. Thus, doesn't need to listen to
// EXTERNAL_APPLICATIONS_UNAVAILABLE.
final IntentFilter externalIntentFilter = final IntentFilter externalIntentFilter =
new IntentFilter(Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE); new IntentFilter(Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE);
userAllContext.registerReceiver( userAllContext.registerReceiver(