The CommonsBlog

Android 4.4 Permission Regressions

Edison Wang tweeted a change in the behavior of ACTION_MEDIA_MOUNTED.

From the SDK standpoint, this was a broadcast that developers were meant to consume, by having a BroadcastReceiver listening for it. However, many blog posts, StackOverflow answers, and the like advocated having apps send that broadcast, as it triggered a complete re-scan of external storage, for the purposes of MediaStore.

Sending such a broadcast would trigger warnings in LogCat in Android 4.3, but now, as of Android 4.4, I can confirm that your app will crash with a SecurityException for trying to send it. Instead, use MediaScannerConnection or ACTION_MEDIA_SCANNER_SCAN_FILE to request indexing of new files.

Also, Sven Knispel reported that the BATTERY_STATS permission is now system|signature. This should impact relatively few applications, as I am not aware that BATTERY_STATS was used for anything that is part of the Android SDK. However, if you were breaking past the boundaries of the SDK and poking at some battery details by one means or another, note that this may no longer work.

The Busy Coder’s Guide to Android Development: the most Android knowledge allowed by law! :-)