Skip to content

Commit

Permalink
FIX afreakyelf#70 Storage permissions not required to save file in Do…
Browse files Browse the repository at this point in the history
…wnload directory when targetSdkVersion > 30 (Android 11)
  • Loading branch information
Gulsher committed Oct 5, 2023
1 parent 318a2e1 commit 1e257ad
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions pdfViewer/src/main/java/com/rajat/pdfviewer/PdfViewerActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,15 @@ class PdfViewerActivity : AppCompatActivity() {
}

private fun checkPermissionOnInit() {
if (ContextCompat.checkSelfPermission(
this,
permission.WRITE_EXTERNAL_STORAGE
) === PackageManager.PERMISSION_GRANTED
) {
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.R){
if (ContextCompat.checkSelfPermission(
this,
permission.WRITE_EXTERNAL_STORAGE
) == PackageManager.PERMISSION_GRANTED
) {
permissionGranted = true
}
}else{
permissionGranted = true
}
}
Expand Down

0 comments on commit 1e257ad

Please sign in to comment.