Merge pull request #1432 from vector-im/feature/bma/installApk
Install apk from the app - REQUEST_INSTALL_PACKAGES
This commit is contained in:
commit
f607b557ff
9 changed files with 99 additions and 22 deletions
|
|
@ -51,4 +51,12 @@ object MimeTypes {
|
|||
fun String?.isMimeTypeFile() = this?.startsWith("file/").orFalse()
|
||||
fun String?.isMimeTypeText() = this?.startsWith("text/").orFalse()
|
||||
fun String?.isMimeTypeAny() = this?.startsWith("*/").orFalse()
|
||||
|
||||
fun fromFileExtension(fileExtension: String): String {
|
||||
return when (fileExtension.lowercase()) {
|
||||
"apk" -> Apk
|
||||
"pdf" -> Pdf
|
||||
else -> OctetStream
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package io.element.android.libraries.matrix.impl.media
|
||||
|
||||
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
|
||||
import io.element.android.libraries.core.mimetype.MimeTypes
|
||||
import io.element.android.libraries.matrix.api.media.MatrixMediaLoader
|
||||
import io.element.android.libraries.matrix.api.media.MediaFile
|
||||
import io.element.android.libraries.matrix.api.media.MediaSource
|
||||
|
|
@ -77,7 +78,7 @@ class RustMediaLoader(
|
|||
val mediaFile = innerClient.getMediaFile(
|
||||
mediaSource = mediaSource,
|
||||
body = body,
|
||||
mimeType = mimeType ?: "application/octet-stream",
|
||||
mimeType = mimeType ?: MimeTypes.OctetStream,
|
||||
tempDir = cacheDirectory.path,
|
||||
)
|
||||
RustMediaFile(mediaFile)
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@
|
|||
<string name="common_gif">"GIF"</string>
|
||||
<string name="common_image">"Image"</string>
|
||||
<string name="common_in_reply_to">"In reply to %1$s"</string>
|
||||
<string name="common_install_apk_android">"Install APK"</string>
|
||||
<string name="common_invite_unknown_profile">"This Matrix ID can\'t be found, so the invite might not be received."</string>
|
||||
<string name="common_leaving_room">"Leaving room"</string>
|
||||
<string name="common_link_copied_to_clipboard">"Link copied to clipboard"</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue