Skip to content

Commit

Permalink
add RequiersPermission annotation for setRequireOriginal api
Browse files Browse the repository at this point in the history
  • Loading branch information
DSOTM-pf committed Aug 4, 2021
1 parent 9a713a3 commit 959f2be
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions saf/src/main/java/com/crazylegend/saf/SafExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ inline fun Context.getLocationFromImages(uri: Uri, latNLongCallBack: (latNLong:
}

@RequiresApi(Build.VERSION_CODES.Q)
@RequiresPermission(ACCESS_MEDIA_LOCATION)
fun Context.flipImageHorizontally(uri: Uri) {
val photoUri = MediaStore.setRequireOriginal(uri)
contentResolver.openInputStream(photoUri).use { stream ->
Expand All @@ -52,6 +53,7 @@ fun Context.flipImageHorizontally(uri: Uri) {
}

@RequiresApi(Build.VERSION_CODES.Q)
@RequiresPermission(ACCESS_MEDIA_LOCATION)
fun Context.flipImageVertically(uri: Uri) {
val photoUri = MediaStore.setRequireOriginal(uri)
contentResolver.openInputStream(photoUri).use { stream ->
Expand Down

0 comments on commit 959f2be

Please sign in to comment.