Skip to content

Commit e3a8781

Browse files
committed
Merge branch 'release/1.6.16' into main
2 parents 310cecf + 10d89f2 commit e3a8781

File tree

66 files changed

+563
-2852
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+563
-2852
lines changed

.github/workflows/sync-from-external-sources.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -58,27 +58,3 @@ jobs:
5858
- Update SAS Strings from matrix-doc.
5959
branch: sync-sas-strings
6060
base: develop
61-
62-
sync-analytics-plan:
63-
runs-on: ubuntu-latest
64-
# Skip in forks
65-
if: github.repository == 'element-hq/element-android'
66-
# No concurrency required, runs every time on a schedule.
67-
steps:
68-
- uses: actions/checkout@v3
69-
- name: Run analytics import script
70-
run: ./tools/import_analytic_plan.sh
71-
- name: Create Pull Request for analytics plan
72-
uses: peter-evans/create-pull-request@v5
73-
with:
74-
commit-message: Sync analytics plan
75-
title: Sync analytics plan
76-
body: |
77-
### Update analytics plan
78-
Reviewers:
79-
- [ ] Please remove usage of Event or Enum which may have been removed or updated
80-
- [ ] please ensure new Events or new Enums are used to send analytics by pushing new commit(s) to this PR.
81-
82-
*Note*: Change are coming from [this project](https://github.com/matrix-org/matrix-analytics-events)
83-
branch: sync-analytics-plan
84-
base: develop

CHANGES.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
Changes in Element v1.6.16 (2024-05-29)
2+
=======================================
3+
4+
Bugfixes 🐛
5+
----------
6+
- Fix crash when accessing a local file and permission is revoked. ([#3616](https://github.com/element-hq/element-android/issues/3616))
7+
- Fixes Element on Android 12+ being ineligible for URL deeplinks ([#5748](https://github.com/element-hq/element-android/issues/5748))
8+
- Restore formatting when restoring a draft. Also keep formatting when switching composer mode. ([#7466](https://github.com/element-hq/element-android/issues/7466))
9+
10+
Other changes
11+
-------------
12+
- Update posthog sdk to 3.2.0 ([#8820](https://github.com/element-hq/element-android/issues/8820))
13+
- Update Rust crypto SDK to version 0.4.1 ([#8838](https://github.com/element-hq/element-android/issues/8838))
14+
15+
116
Changes in Element v1.6.14 (2024-04-02)
217
=======================================
318

dependencies_groups.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ext.groups = [
99
'com.github.hyuwah',
1010
'com.github.jetradarmobile',
1111
'com.github.MatrixFrog',
12+
'com.github.matrix-org',
1213
'com.github.tapadoo',
1314
'com.github.UnifiedPush',
1415
'com.github.yalantis',
@@ -120,7 +121,7 @@ ext.groups = [
120121
'com.parse.bolts',
121122
'com.pinterest',
122123
'com.pinterest.ktlint',
123-
'com.posthog.android',
124+
'com.posthog',
124125
'com.squareup',
125126
'com.squareup.curtains',
126127
'com.squareup.duktape',

docs/analytics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ We ask for the user to give consent before sending any analytics data.
1717

1818
The analytics plan is shared between all Element clients. To add an Event, please open a PR to this project: https://github.com/matrix-org/matrix-analytics-events
1919

20-
Then, once the PR has been merged, you can run the tool `import_analytic_plan.sh` to import the plan to Element, and then you can use the new Event. Note that this tool is run by Github action once a week.
20+
Then, once the PR has been merged, and the library is release, you can update the version of the library in the `build.gradle` file.
2121

2222
## Forks of Element
2323

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Main changes in this version: Bug fixes.
2+
Full changelog: https://github.com/element-hq/element-android/releases

library/multipicker/src/main/java/im/vector/lib/multipicker/AudioPicker.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class AudioPicker : Picker<MultiPickerAudioType>() {
3131
* Returns selected audio files or empty list if user did not select any files.
3232
*/
3333
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerAudioType> {
34-
return getSelectedUriList(data).mapNotNull { selectedUri ->
34+
return getSelectedUriList(context, data).mapNotNull { selectedUri ->
3535
selectedUri.toMultiPickerAudioType(context)
3636
}
3737
}

library/multipicker/src/main/java/im/vector/lib/multipicker/FilePicker.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class FilePicker : Picker<MultiPickerBaseType>() {
4141
* Returns selected files or empty list if user did not select any files.
4242
*/
4343
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerBaseType> {
44-
return getSelectedUriList(data).mapNotNull { selectedUri ->
44+
return getSelectedUriList(context, data).mapNotNull { selectedUri ->
4545
val type = context.contentResolver.getType(selectedUri)
4646

4747
when {

library/multipicker/src/main/java/im/vector/lib/multipicker/ImagePicker.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ImagePicker : Picker<MultiPickerImageType>() {
3131
* Returns selected image files or empty list if user did not select any files.
3232
*/
3333
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerImageType> {
34-
return getSelectedUriList(data).mapNotNull { selectedUri ->
34+
return getSelectedUriList(context, data).mapNotNull { selectedUri ->
3535
selectedUri.toMultiPickerImageType(context)
3636
}
3737
}

library/multipicker/src/main/java/im/vector/lib/multipicker/MediaPicker.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class MediaPicker : Picker<MultiPickerBaseMediaType>() {
3333
* Returns selected image/video files or empty list if user did not select any files.
3434
*/
3535
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerBaseMediaType> {
36-
return getSelectedUriList(data).mapNotNull { selectedUri ->
36+
return getSelectedUriList(context, data).mapNotNull { selectedUri ->
3737
val mimeType = context.contentResolver.getType(selectedUri)
3838

3939
if (mimeType.isMimeTypeVideo()) {

library/multipicker/src/main/java/im/vector/lib/multipicker/Picker.kt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package im.vector.lib.multipicker
1818

19+
import android.content.ComponentName
1920
import android.content.Context
2021
import android.content.Intent
2122
import android.content.pm.PackageManager
@@ -58,7 +59,17 @@ abstract class Picker<T> {
5859
uriList.forEach {
5960
for (resolveInfo in resInfoList) {
6061
val packageName: String = resolveInfo.activityInfo.packageName
61-
context.grantUriPermission(packageName, it, Intent.FLAG_GRANT_READ_URI_PERMISSION)
62+
63+
// Replace implicit intent by an explicit to fix crash on some devices like Xiaomi.
64+
// see https://juejin.cn/post/7031736325422186510
65+
try {
66+
context.grantUriPermission(packageName, it, Intent.FLAG_GRANT_READ_URI_PERMISSION)
67+
} catch (e: Exception) {
68+
continue
69+
}
70+
data.action = null
71+
data.component = ComponentName(packageName, resolveInfo.activityInfo.name)
72+
break
6273
}
6374
}
6475
return getSelectedFiles(context, data)
@@ -82,7 +93,7 @@ abstract class Picker<T> {
8293
activityResultLauncher.launch(createIntent().apply { addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) })
8394
}
8495

85-
protected fun getSelectedUriList(data: Intent?): List<Uri> {
96+
protected fun getSelectedUriList(context: Context, data: Intent?): List<Uri> {
8697
val selectedUriList = mutableListOf<Uri>()
8798
val dataUri = data?.data
8899
val clipData = data?.clipData
@@ -104,6 +115,6 @@ abstract class Picker<T> {
104115
}
105116
}
106117
}
107-
return selectedUriList
118+
return selectedUriList.onEach { context.grantUriPermission(context.applicationContext.packageName, it, Intent.FLAG_GRANT_READ_URI_PERMISSION) }
108119
}
109120
}

0 commit comments

Comments
 (0)