Files
.github
LICENSES
android
app
gradle
include
.gitignore
PrivacyPolicy.rst
README.md
build.gradle.kts
build.py
custom_rules.xml
gdb.sh
gradle.properties
gradlew
gradlew.bat
meson.build
settings.gradle.kts
build
doc
python
src
subprojects
systemd
test
win32
.clang-format
.gitignore
.readthedocs.yaml
AUTHORS
COPYING
NEWS
README.md
meson.build
meson_options.txt
mpd.svg
valgrind.suppressions
mpd/android
gd 51242be72b android: changed permissions handling UI in status screen when show rationale is false
Android will ignore permission request and will not show the request dialog
if the user's action implies "don't ask again."
This leaves the app in a crippled state and the user confused.
Google says "don't try to convince the user", so it returns false for `shouldShowRequestPermissionRationale`.

To help the user proceed, we show the `Request permission` button only if `shouldShowRequestPermissionRationale == true`
because there's a good chance the premission request dialog will not be ignored.

If `shouldShowRequestPermissionRationale == false` we instead show the "rationale" message and a button to open
the app info dialog where the user can explicitly grand the permission.
2025-02-04 10:22:57 +02:00
..
2014-02-22 01:39:08 +01:00
2022-04-26 17:47:54 +02:00

Android

Notes and resources for MPD android maintainers.

Android studio

Version control

git ignoring .idea directory completely until a good reason emerges not to

Native libraries

Permissions

Files access

The required permission depends on android SDK version:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
    Manifest.permission.READ_MEDIA_AUDIO
else
    Manifest.permission.READ_EXTERNAL_STORAGE

Permission request

Request runtime permissions

Since Android 6.0 (API level 23):

Android will ignore permission request and will not show the request dialog if the user's action implies "don't ask again." This leaves the app in a crippled state and the user confused. Google says "don't try to convince the user", so it returns false for shouldShowRequestPermissionRationale.

To help the user proceed, we show the Request permission button only if shouldShowRequestPermissionRationale == true because there's a good chance the permission request dialog will not be ignored.

If shouldShowRequestPermissionRationale == false we instead show the "rationale" message and a button to open the app info dialog where the user can explicitly grand the permission.