-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix file access permission #1022
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mutualiser la configuration de l'appel getSelectedUriList
@@ -32,6 +32,8 @@ class AudioPicker : Picker<MultiPickerAudioType>() { | |||
*/ | |||
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerAudioType> { | |||
return getSelectedUriList(data).mapNotNull { selectedUri -> | |||
// Tchap: Grant permission to access the selected file. | |||
context.grantUriPermission(context.applicationContext.packageName, selectedUri, Intent.FLAG_GRANT_READ_URI_PERMISSION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourrais être mutualisé dans la classe parente multipicker/Picker::getSelectedUriList
@@ -42,6 +42,9 @@ class FilePicker : Picker<MultiPickerBaseType>() { | |||
*/ | |||
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerBaseType> { | |||
return getSelectedUriList(data).mapNotNull { selectedUri -> | |||
// Tchap: Grant permission to access the selected file. | |||
context.grantUriPermission(context.applicationContext.packageName, selectedUri, Intent.FLAG_GRANT_READ_URI_PERMISSION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourrais être mutualisé dans la classe parente multipicker/Picker::getSelectedUriList
@@ -32,6 +32,8 @@ class ImagePicker : Picker<MultiPickerImageType>() { | |||
*/ | |||
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerImageType> { | |||
return getSelectedUriList(data).mapNotNull { selectedUri -> | |||
// Tchap: Grant permission to access the selected file. | |||
context.grantUriPermission(context.applicationContext.packageName, selectedUri, Intent.FLAG_GRANT_READ_URI_PERMISSION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourrais être mutualisé dans la classe parente multipicker/Picker::getSelectedUriList
@@ -34,6 +34,9 @@ class MediaPicker : Picker<MultiPickerBaseMediaType>() { | |||
*/ | |||
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerBaseMediaType> { | |||
return getSelectedUriList(data).mapNotNull { selectedUri -> | |||
// Tchap: Grant permission to access the selected file. | |||
context.grantUriPermission(context.applicationContext.packageName, selectedUri, Intent.FLAG_GRANT_READ_URI_PERMISSION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourrais être mutualisé dans la classe parente multipicker/Picker::getSelectedUriList
@@ -32,6 +32,8 @@ class VideoPicker : Picker<MultiPickerVideoType>() { | |||
*/ | |||
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerVideoType> { | |||
return getSelectedUriList(data).mapNotNull { selectedUri -> | |||
// Tchap: Grant permission to access the selected file. | |||
context.grantUriPermission(context.applicationContext.packageName, selectedUri, Intent.FLAG_GRANT_READ_URI_PERMISSION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourrais être mutualisé dans la classe parente multipicker/Picker::getSelectedUriList
@@ -52,7 +52,7 @@ sealed class RoomDetailAction : VectorViewModelAction { | |||
|
|||
data class ResendMessage(val eventId: String) : RoomDetailAction() | |||
data class RemoveFailedEcho(val eventId: String) : RoomDetailAction() | |||
data class CancelSend(val eventId: String, val force: Boolean) : RoomDetailAction() | |||
data class CancelSend(val event: TimelineEvent, val force: Boolean) : RoomDetailAction() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ajouter un Tchap commentaire
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
je préfère ne pas en mettre. le lint oblige d'ajouter un saut de ligne au dessus du commentaire. ca rajoute de la complexité inutile en cas de conflit.
@@ -71,7 +72,7 @@ sealed class EventSharedAction( | |||
data class Redact(val eventId: String, val askForReason: Boolean, val dialogTitleRes: Int, val dialogDescriptionRes: Int) : | |||
EventSharedAction(R.string.message_action_item_redact, R.drawable.ic_delete, true) | |||
|
|||
data class Cancel(val eventId: String, val force: Boolean) : | |||
data class Cancel(val event: TimelineEvent, val force: Boolean) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Tchap commentaire
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
je préfère ne pas en mettre. le lint oblige d'ajouter un saut de ligne au dessus du commentaire. ca rajoute de la complexité inutile en cas de conflit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ajouter un changelog STP
d22e847
to
efdec04
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR assez conséquente ! Bravo 👏
LGTM
Type of change
Content
Fix #642 #766 #851 #911
Motivation and context
Screenshots / GIFs
Tests
Tested devices
Checklist