mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-18 22:37:43 +00:00
Merge pull request #11299 from keymanapp/fix/android/storage-permission-2
fix(android/app): Update storage permissions for Android 12.0+
This commit is contained in:
commit
32a863286f
5 changed files with 34 additions and 9 deletions
|
|
@ -7,6 +7,10 @@
|
|||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
|
||||
<!-- API 33 and above -->
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
||||
|
||||
<!-- Devices running up to Android 12L
|
||||
Starting in API level 33, this permission has no effect:
|
||||
https://developer.android.com/reference/android/Manifest.permission#READ_EXTERNAL_STORAGE -->
|
||||
|
|
|
|||
|
|
@ -26,13 +26,19 @@ public class CheckPermissions {
|
|||
return permissionsOK;
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.R) {
|
||||
permissionsOK = Environment.isExternalStorageManager();
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU) {
|
||||
// TODO: Workout scoped storage permission #10659
|
||||
}
|
||||
} else {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
|
||||
// < API 30
|
||||
permissionsOK = checkPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||
} else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
// API 30-32
|
||||
permissionsOK = Environment.isExternalStorageManager() ||
|
||||
checkPermission(activity, Manifest.permission.READ_EXTERNAL_STORAGE);
|
||||
} else {
|
||||
// API 33+
|
||||
//https://developer.android.com/about/versions/13/behavior-changes-13#granular-media-permissions
|
||||
// Manifest.permission.READ_MEDIA_AUDIO doesn't seem to be needed
|
||||
permissionsOK = permissionsOK && checkPermission(activity, Manifest.permission.READ_MEDIA_IMAGES);
|
||||
permissionsOK = permissionsOK && checkPermission(activity, Manifest.permission.READ_MEDIA_VIDEO);
|
||||
}
|
||||
|
||||
return permissionsOK;
|
||||
|
|
|
|||
BIN
android/help/android_images/keyman-storage-permission-34b.png
Normal file
BIN
android/help/android_images/keyman-storage-permission-34b.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 38 KiB |
|
|
@ -2,15 +2,30 @@
|
|||
title: How To - Granting Storage Permission
|
||||
---
|
||||
|
||||
## Granting storage permission
|
||||
## Granting Storage Permission
|
||||
If Keyman for Android is permanently denied storage access, attempts to install custom packages will fail with the
|
||||
notification "Storage permission request was denied". Perform these steps to grant Keyman for Android access to storage
|
||||
|
||||
### Android 11.0 to 12L Devices
|
||||
|
||||
Step 1)
|
||||
Go to Android Settings.
|
||||
|
||||
Step 2)
|
||||
Depending on your device, click "Apps", "Apps & notifications", or "App permissions" and grant Keyman
|
||||
storage permission. The screenshot below is from Android 9.0 Pie.
|
||||
permission to access storage / "file and media". The screenshot below is from Android 12.0 S.
|
||||
|
||||

|
||||

|
||||
|
||||
### Android 13.0+ Devices
|
||||
|
||||
Step 1)
|
||||
Go to Android Settings.
|
||||
|
||||
Step 2)
|
||||
Depending on your device, click "Apps" and grant Keyman permission to the following:
|
||||
* Photos and videos --> Always allow all
|
||||
|
||||
The screenshot below is from Android 14.0.
|
||||
|
||||

|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue