简体   繁体   中英

What permission can I use for ACTION_MEDIA_SCANNER_SCAN_FILE intents?

A security review flagged the use of sendBroadcast calls in our App without a permission parameter. We only use sendBroadcast to invoke the Android Media Scanner, and I don't think that app will have any unique permissions.

Is there a system permission I can use? Otherwise, what stops other apps potentially receiving these broadcasts also?

Is there a system permission I can use?

There is no documented permission that you could apply that would restrict the recipients yet ensure that the MediaStore receives it.

Otherwise, what stops other apps potentially receiving these broadcasts also?

Nothing. And in this particular case, there is no real problem. The point of ACTION_MEDIA_SCANNER_SCAN_FILE is to add publicly-visible content to the MediaStore . Most other apps will find out about that by keeping tabs on the MediaStore . Another app could listen for this broadcast, and perhaps find out about the content a few milliseconds earlier than others.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM