Skip to content

Commit

Permalink
Add new permissions to picture service (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
jperedadnr authored Nov 12, 2024
1 parent 860ea03 commit fe08229
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Gluon
* Copyright (c) 2020, 2024, Gluon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -73,8 +73,16 @@ public DalvikPicturesService(Activity activity) {

private boolean verifyPermissions() {
if (!verified) {
verified = Util.verifyPermissions(Manifest.permission.CAMERA,
Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE);
if (Build.VERSION.SDK_INT >= 33) {
verified = Util.verifyPermissions(Manifest.permission.CAMERA,
Manifest.permission.READ_MEDIA_AUDIO,
Manifest.permission.READ_MEDIA_IMAGES,
Manifest.permission.READ_MEDIA_VIDEO);
} else {
verified = Util.verifyPermissions(Manifest.permission.CAMERA,
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE);
}
}
return verified;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<uses-sdk android:minSdkVersion="21" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<application>
<provider android:name="com.gluonhq.helloandroid.FileProvider"
android:authorities="${applicationId}.fileprovider"
Expand Down

0 comments on commit fe08229

Please sign in to comment.