Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cropper/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/library_file_paths"/>
android:resource="@xml/cropper_library_file_paths"/>
</provider>
<activity
android:name="com.canhub.cropper.CropImageActivity"
Expand Down
15 changes: 2 additions & 13 deletions cropper/src/main/kotlin/com/canhub/cropper/BitmapUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import android.graphics.Rect
import android.graphics.RectF
import android.net.Uri
import android.os.Build.VERSION.SDK_INT
import android.os.Environment
import android.util.Log
import android.util.Pair
import androidx.exifinterface.media.ExifInterface
Expand Down Expand Up @@ -457,18 +456,8 @@ internal object BitmapUtils {
}
// We have this because of a HUAWEI path bug when we use getUriForFile
if (SDK_INT >= 29) {
try {
val file = File.createTempFile(
"cropped",
ext,
context.getExternalFilesDir(Environment.DIRECTORY_PICTURES),
)
getUriForFile(context, file)
} catch (e: Exception) {
Log.e("AIC", "${e.message}")
val file = File.createTempFile("cropped", ext, context.cacheDir)
getUriForFile(context, file)
}
val file = File.createTempFile("cropped", ext, context.cacheDir)
getUriForFile(context, file)
} else {
Uri.fromFile(File.createTempFile("cropped", ext, context.cacheDir))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.core.content.FileProvider
*
* See https://developer.android.com/guide/topics/manifest/provider-element.html for details.
*/
class CropFileProvider : FileProvider() {
class CropFileProvider : FileProvider(R.xml.cropper_library_file_paths) {
// This class intentionally left blank.
// https://android-review.googlesource.com/c/platform/frameworks/support/+/1978527
}