fix: remove GRANT_READ_URI_PERMISSION intent flag
According to Gemini it's causing the rare java.lang.SecurityException I see in the crash analytics and it's not necessary.
This commit is contained in:
1 parent
105f739e3c
commit
b263ffa28d
1 file changed
-6
@@ -50,7 +50,6 @@ fun getConfirmOperationActivityIntent(
|
|||||||
): Intent {
|
): Intent {
|
||||||
return mkIntent(packageContext, cls).apply {
|
return mkIntent(packageContext, cls).apply {
|
||||||
data = sourceUri
|
data = sourceUri
|
||||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
|
||||||
putExtra("sourceUri", sourceUri)
|
putExtra("sourceUri", sourceUri)
|
||||||
putExtra("destDevice", destDevice)
|
putExtra("destDevice", destDevice)
|
||||||
}
|
}
|
||||||
@@ -68,7 +67,6 @@ fun getStartJobIntent(
|
|||||||
return mkIntent(packageContext, cls).apply {
|
return mkIntent(packageContext, cls).apply {
|
||||||
action = Intents.START_JOB
|
action = Intents.START_JOB
|
||||||
data = sourceUri
|
data = sourceUri
|
||||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
|
||||||
putExtra("sourceUri", sourceUri)
|
putExtra("sourceUri", sourceUri)
|
||||||
putExtra("destDevice", destDevice)
|
putExtra("destDevice", destDevice)
|
||||||
putExtra("jobId", jobId)
|
putExtra("jobId", jobId)
|
||||||
@@ -89,7 +87,6 @@ fun getProgressUpdateIntent(
|
|||||||
cls: Class<*>? = null,
|
cls: Class<*>? = null,
|
||||||
) = mkIntent(packageContext, cls).apply {
|
) = mkIntent(packageContext, cls).apply {
|
||||||
action = Intents.JOB_PROGRESS
|
action = Intents.JOB_PROGRESS
|
||||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
|
||||||
putExtra("sourceUri", sourceUri)
|
putExtra("sourceUri", sourceUri)
|
||||||
putExtra(
|
putExtra(
|
||||||
"status", JobStatusInfo(
|
"status", JobStatusInfo(
|
||||||
@@ -110,7 +107,6 @@ fun getErrorIntent(
|
|||||||
cls: Class<*>? = null,
|
cls: Class<*>? = null,
|
||||||
) = mkIntent(packageContext, cls).apply {
|
) = mkIntent(packageContext, cls).apply {
|
||||||
action = Intents.ERROR
|
action = Intents.ERROR
|
||||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
|
||||||
putExtra("sourceUri", sourceUri)
|
putExtra("sourceUri", sourceUri)
|
||||||
putExtra(
|
putExtra(
|
||||||
"status",
|
"status",
|
||||||
@@ -129,7 +125,6 @@ fun getFinishedIntent(
|
|||||||
cls: Class<*>? = null,
|
cls: Class<*>? = null,
|
||||||
) = mkIntent(packageContext, cls).apply {
|
) = mkIntent(packageContext, cls).apply {
|
||||||
action = Intents.FINISHED
|
action = Intents.FINISHED
|
||||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
|
||||||
putExtra("sourceUri", sourceUri)
|
putExtra("sourceUri", sourceUri)
|
||||||
putExtra("status", JobStatusInfo(sourceUri, destDevice, totalBytes, totalBytes, jobId = -1))
|
putExtra("status", JobStatusInfo(sourceUri, destDevice, totalBytes, totalBytes, jobId = -1))
|
||||||
}
|
}
|
||||||
@@ -139,7 +134,6 @@ fun Intent.getProgressActivityPendingIntent(
|
|||||||
): PendingIntent = PendingIntent.getActivity(context, requestCode, this.apply {
|
): PendingIntent = PendingIntent.getActivity(context, requestCode, this.apply {
|
||||||
// Set data uri to propagate the permission
|
// Set data uri to propagate the permission
|
||||||
if (data == null) data = safeParcelableExtra<Uri?>("sourceUri")
|
if (data == null) data = safeParcelableExtra<Uri?>("sourceUri")
|
||||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
|
||||||
|
|
||||||
addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
||||||
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||||
|
|||||||
Reference in new issue
Block a user