mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Replaced Uri.parse() by .toUri() string extension
This commit is contained in:
parent
141d7b08a6
commit
96a07fa8c6
19 changed files with 46 additions and 41 deletions
|
|
@ -24,12 +24,12 @@ import android.app.NotificationManager
|
|||
import android.app.Service
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.provider.Settings
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.core.content.ContextCompat
|
||||
import org.linphone.core.tools.Log
|
||||
import androidx.core.net.toUri
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
|
||||
class Api34Compatibility {
|
||||
|
|
@ -69,7 +69,7 @@ class Api34Compatibility {
|
|||
val intent = Intent()
|
||||
// See https://developer.android.com/reference/android/provider/Settings#ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT
|
||||
intent.action = Settings.ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT
|
||||
intent.data = Uri.parse("package:${context.packageName}")
|
||||
intent.data = "package:${context.packageName}".toUri()
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY)
|
||||
Log.i("$TAG Starting ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT")
|
||||
ContextCompat.startActivity(context, intent, null)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
package org.linphone.telecom
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import androidx.annotation.WorkerThread
|
||||
import androidx.core.telecom.CallAttributesCompat
|
||||
import androidx.core.telecom.CallException
|
||||
|
|
@ -36,6 +35,7 @@ import org.linphone.core.Core
|
|||
import org.linphone.core.CoreListenerStub
|
||||
import org.linphone.core.tools.Log
|
||||
import org.linphone.utils.LinphoneUtils
|
||||
import androidx.core.net.toUri
|
||||
|
||||
class TelecomManager
|
||||
@WorkerThread
|
||||
|
|
@ -99,7 +99,7 @@ class TelecomManager
|
|||
Log.i("$TAG Call to [${call.remoteAddress.asStringUriOnly()}] created in state [${call.state}]")
|
||||
|
||||
val address = call.callLog.remoteAddress
|
||||
val uri = Uri.parse(address.asStringUriOnly())
|
||||
val uri = address.asStringUriOnly().toUri()
|
||||
|
||||
val direction = if (call.dir == Call.Dir.Outgoing) {
|
||||
CallAttributesCompat.DIRECTION_OUTGOING
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ package org.linphone.ui.assistant.fragment
|
|||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.telephony.TelephonyManager
|
||||
import android.view.LayoutInflater
|
||||
|
|
@ -44,6 +43,7 @@ import org.linphone.ui.assistant.model.AcceptConditionsAndPolicyDialogModel
|
|||
import org.linphone.ui.assistant.viewmodel.AccountLoginViewModel
|
||||
import org.linphone.utils.DialogUtils
|
||||
import org.linphone.utils.PhoneNumberUtils
|
||||
import androidx.core.net.toUri
|
||||
|
||||
@UiThread
|
||||
class LandingFragment : GenericFragment() {
|
||||
|
|
@ -104,7 +104,7 @@ class LandingFragment : GenericFragment() {
|
|||
binding.setForgottenPasswordClickListener {
|
||||
val url = getString(R.string.web_platform_forgotten_password_url)
|
||||
try {
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, url.toUri())
|
||||
startActivity(browserIntent)
|
||||
} catch (ise: IllegalStateException) {
|
||||
Log.e(
|
||||
|
|
@ -207,7 +207,7 @@ class LandingFragment : GenericFragment() {
|
|||
it.consume {
|
||||
val url = getString(R.string.website_privacy_policy_url)
|
||||
try {
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, url.toUri())
|
||||
startActivity(browserIntent)
|
||||
} catch (ise: IllegalStateException) {
|
||||
Log.e(
|
||||
|
|
@ -221,7 +221,7 @@ class LandingFragment : GenericFragment() {
|
|||
it.consume {
|
||||
val url = getString(R.string.website_terms_and_conditions_url)
|
||||
try {
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, url.toUri())
|
||||
startActivity(browserIntent)
|
||||
} catch (ise: IllegalStateException) {
|
||||
Log.e(
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ package org.linphone.ui.assistant.fragment
|
|||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.telephony.TelephonyManager
|
||||
import android.text.Editable
|
||||
|
|
@ -49,6 +48,7 @@ import org.linphone.utils.ConfirmationDialogModel
|
|||
import org.linphone.utils.AppUtils
|
||||
import org.linphone.utils.DialogUtils
|
||||
import org.linphone.utils.PhoneNumberUtils
|
||||
import androidx.core.net.toUri
|
||||
|
||||
@UiThread
|
||||
class RegisterFragment : GenericFragment() {
|
||||
|
|
@ -102,7 +102,7 @@ class RegisterFragment : GenericFragment() {
|
|||
binding.setOpenSubscribeWebPageClickListener {
|
||||
val url = getString(R.string.web_platform_register_email_url)
|
||||
try {
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, url.toUri())
|
||||
startActivity(browserIntent)
|
||||
} catch (ise: IllegalStateException) {
|
||||
Log.e(
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
package org.linphone.ui.assistant.fragment
|
||||
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
|
|
@ -31,6 +30,7 @@ import org.linphone.R
|
|||
import org.linphone.core.tools.Log
|
||||
import org.linphone.databinding.AssistantThirdPartySipAccountWarningFragmentBinding
|
||||
import org.linphone.ui.GenericFragment
|
||||
import androidx.core.net.toUri
|
||||
|
||||
@UiThread
|
||||
class ThirdPartySipAccountWarningFragment : GenericFragment() {
|
||||
|
|
@ -61,7 +61,7 @@ class ThirdPartySipAccountWarningFragment : GenericFragment() {
|
|||
binding.setContactClickListener {
|
||||
val url = getString(R.string.website_contact_url)
|
||||
try {
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, url.toUri())
|
||||
startActivity(browserIntent)
|
||||
} catch (ise: IllegalStateException) {
|
||||
Log.e(
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package org.linphone.ui.fileviewer
|
||||
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.util.DisplayMetrics
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
|
|
@ -23,6 +22,7 @@ import org.linphone.ui.GenericActivity
|
|||
import org.linphone.ui.fileviewer.adapter.PdfPagesListAdapter
|
||||
import org.linphone.ui.fileviewer.viewmodel.FileViewModel
|
||||
import org.linphone.utils.FileUtils
|
||||
import androidx.core.net.toUri
|
||||
|
||||
@UiThread
|
||||
class FileViewerActivity : GenericActivity() {
|
||||
|
|
@ -186,7 +186,7 @@ class FileViewerActivity : GenericActivity() {
|
|||
val filePath = FileUtils.getProperFilePath(viewModel.getFilePath())
|
||||
val copy = FileUtils.getFilePath(
|
||||
baseContext,
|
||||
Uri.parse(filePath),
|
||||
filePath.toUri(),
|
||||
overrideExisting = false,
|
||||
copyToCache = true
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package org.linphone.ui.fileviewer
|
||||
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.annotation.UiThread
|
||||
|
|
@ -28,6 +27,7 @@ import org.linphone.ui.main.chat.model.FileModel
|
|||
import org.linphone.ui.main.viewmodel.SharedMainViewModel
|
||||
import org.linphone.utils.AppUtils
|
||||
import org.linphone.utils.FileUtils
|
||||
import androidx.core.net.toUri
|
||||
|
||||
@UiThread
|
||||
class MediaViewerActivity : GenericActivity() {
|
||||
|
|
@ -247,7 +247,7 @@ class MediaViewerActivity : GenericActivity() {
|
|||
val filePath = FileUtils.getProperFilePath(model.path)
|
||||
val copy = FileUtils.getFilePath(
|
||||
baseContext,
|
||||
Uri.parse(filePath),
|
||||
filePath.toUri(),
|
||||
overrideExisting = true,
|
||||
copyToCache = true
|
||||
)
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import org.linphone.ui.GenericViewModel
|
|||
import org.linphone.utils.Event
|
||||
import org.linphone.utils.FileUtils
|
||||
import org.linphone.utils.TimestampUtils
|
||||
import androidx.core.net.toUri
|
||||
|
||||
class FileViewModel
|
||||
@UiThread
|
||||
|
|
@ -232,7 +233,7 @@ class FileViewModel
|
|||
|
||||
@UiThread
|
||||
fun copyFileToUri(dest: Uri) {
|
||||
val source = Uri.parse(FileUtils.getProperFilePath(getFilePath()))
|
||||
val source = FileUtils.getProperFilePath(getFilePath()).toUri()
|
||||
Log.i("$TAG Copying file URI [$source] to [$dest]")
|
||||
viewModelScope.launch {
|
||||
withContext(Dispatchers.IO) {
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ import org.linphone.utils.addCharacterAtPosition
|
|||
import org.linphone.utils.hideKeyboard
|
||||
import org.linphone.utils.setKeyboardInsetListener
|
||||
import org.linphone.utils.showKeyboard
|
||||
import androidx.core.net.toUri
|
||||
|
||||
@UiThread
|
||||
open class ConversationFragment : SlidingPaneChildFragment() {
|
||||
|
|
@ -782,7 +783,7 @@ open class ConversationFragment : SlidingPaneChildFragment() {
|
|||
if (messageLongPressViewModel.visible.value == true) return@consume
|
||||
Log.i("$TAG Requesting to open web browser on page [$url]")
|
||||
try {
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, url.toUri())
|
||||
startActivity(browserIntent)
|
||||
} catch (e: Exception) {
|
||||
Log.e(
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ package org.linphone.ui.main.chat.model
|
|||
import android.media.MediaMetadataRetriever
|
||||
import android.media.MediaMetadataRetriever.METADATA_KEY_DURATION
|
||||
import android.media.ThumbnailUtils
|
||||
import android.net.Uri
|
||||
import android.provider.MediaStore
|
||||
import androidx.annotation.AnyThread
|
||||
import androidx.annotation.UiThread
|
||||
|
|
@ -35,6 +34,7 @@ import org.linphone.LinphoneApplication.Companion.coreContext
|
|||
import org.linphone.core.tools.Log
|
||||
import org.linphone.utils.FileUtils
|
||||
import org.linphone.utils.TimestampUtils
|
||||
import androidx.core.net.toUri
|
||||
|
||||
class FileModel
|
||||
@AnyThread
|
||||
|
|
@ -186,7 +186,7 @@ class FileModel
|
|||
private fun getDuration() {
|
||||
try {
|
||||
val retriever = MediaMetadataRetriever()
|
||||
retriever.setDataSource(coreContext.context, Uri.parse(path))
|
||||
retriever.setDataSource(coreContext.context, path.toUri())
|
||||
val durationInMs = retriever.extractMetadata(METADATA_KEY_DURATION)?.toInt() ?: 0
|
||||
val seconds = durationInMs / 1000
|
||||
val duration = TimestampUtils.durationToString(seconds)
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ import org.linphone.utils.AppUtils
|
|||
import org.linphone.utils.Event
|
||||
import org.linphone.utils.FileUtils
|
||||
import org.linphone.utils.LinphoneUtils
|
||||
import androidx.core.net.toUri
|
||||
|
||||
class ConversationViewModel
|
||||
@UiThread
|
||||
|
|
@ -974,7 +975,7 @@ class ConversationViewModel
|
|||
|
||||
@UiThread
|
||||
fun copyFileToUri(filePath: String, dest: Uri) {
|
||||
val source = Uri.parse(FileUtils.getProperFilePath(filePath))
|
||||
val source = FileUtils.getProperFilePath(filePath).toUri()
|
||||
Log.i("$TAG Copying file URI [$source] to [$dest]")
|
||||
viewModelScope.launch {
|
||||
withContext(Dispatchers.IO) {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import android.content.ClipData
|
|||
import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.provider.ContactsContract
|
||||
import android.view.LayoutInflater
|
||||
|
|
@ -52,6 +51,7 @@ import org.linphone.utils.AppUtils
|
|||
import org.linphone.utils.ConfirmationDialogModel
|
||||
import org.linphone.utils.DialogUtils
|
||||
import org.linphone.utils.Event
|
||||
import androidx.core.net.toUri
|
||||
|
||||
@UiThread
|
||||
class ContactFragment : SlidingPaneChildFragment() {
|
||||
|
|
@ -171,7 +171,7 @@ class ContactFragment : SlidingPaneChildFragment() {
|
|||
viewModel.openNativeContactEditor.observe(viewLifecycleOwner) {
|
||||
it.consume { uri ->
|
||||
val editIntent = Intent(Intent.ACTION_EDIT).apply {
|
||||
setDataAndType(Uri.parse(uri), ContactsContract.Contacts.CONTENT_ITEM_TYPE)
|
||||
setDataAndType(uri.toUri(), ContactsContract.Contacts.CONTENT_ITEM_TYPE)
|
||||
putExtra("finishActivityOnSaveCompleted", true)
|
||||
}
|
||||
startActivity(editIntent)
|
||||
|
|
@ -287,7 +287,7 @@ class ContactFragment : SlidingPaneChildFragment() {
|
|||
)
|
||||
val smsIntent: Intent = Intent().apply {
|
||||
action = Intent.ACTION_SENDTO
|
||||
data = Uri.parse("smsto:$number")
|
||||
data = "smsto:$number".toUri()
|
||||
putExtra("address", number)
|
||||
putExtra("sms_body", smsBody)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import org.linphone.core.SecurityLevel
|
|||
import org.linphone.core.tools.Log
|
||||
import org.linphone.utils.AppUtils
|
||||
import org.linphone.utils.TimestampUtils
|
||||
import androidx.core.net.toUri
|
||||
|
||||
class ContactAvatarModel
|
||||
@WorkerThread
|
||||
|
|
@ -151,7 +152,7 @@ class ContactAvatarModel
|
|||
private fun getAvatarUri(friend: Friend): Uri? {
|
||||
val picturePath = friend.photo
|
||||
if (!picturePath.isNullOrEmpty()) {
|
||||
return Uri.parse(picturePath)
|
||||
return picturePath.toUri()
|
||||
}
|
||||
|
||||
val refKey = friend.refKey
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
*/
|
||||
package org.linphone.ui.main.contacts.viewmodel
|
||||
|
||||
import android.net.Uri
|
||||
import androidx.annotation.AnyThread
|
||||
import androidx.annotation.UiThread
|
||||
import androidx.annotation.WorkerThread
|
||||
|
|
@ -42,6 +41,7 @@ import org.linphone.ui.GenericViewModel
|
|||
import org.linphone.ui.main.contacts.model.NewOrEditNumberOrAddressModel
|
||||
import org.linphone.utils.Event
|
||||
import org.linphone.utils.FileUtils
|
||||
import androidx.core.net.toUri
|
||||
|
||||
class ContactNewOrEditViewModel
|
||||
@UiThread
|
||||
|
|
@ -183,7 +183,7 @@ class ContactNewOrEditViewModel
|
|||
isImage = true,
|
||||
overrideExisting = true
|
||||
)
|
||||
val oldFile = Uri.parse(FileUtils.getProperFilePath(picture))
|
||||
val oldFile = FileUtils.getProperFilePath(picture).toUri()
|
||||
viewModelScope.launch {
|
||||
FileUtils.copyFile(oldFile, newFile)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
package org.linphone.ui.main.fragment
|
||||
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
|
|
@ -46,6 +45,7 @@ import org.linphone.ui.assistant.AssistantActivity
|
|||
import org.linphone.ui.main.MainActivity
|
||||
import org.linphone.ui.main.settings.fragment.AccountProfileFragmentDirections
|
||||
import org.linphone.ui.main.viewmodel.DrawerMenuViewModel
|
||||
import androidx.core.net.toUri
|
||||
|
||||
@UiThread
|
||||
class DrawerMenuFragment : GenericMainFragment() {
|
||||
|
|
@ -146,7 +146,7 @@ class DrawerMenuFragment : GenericMainFragment() {
|
|||
viewModel.openLinkInBrowserEvent.observe(viewLifecycleOwner) {
|
||||
it.consume { link ->
|
||||
try {
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(link))
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, link.toUri())
|
||||
startActivity(browserIntent)
|
||||
} catch (ise: IllegalStateException) {
|
||||
Log.e(
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
package org.linphone.ui.main.help.fragment
|
||||
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
|
|
@ -36,6 +35,7 @@ import org.linphone.ui.main.fragment.GenericMainFragment
|
|||
import org.linphone.ui.main.help.viewmodel.HelpViewModel
|
||||
import org.linphone.utils.ConfirmationDialogModel
|
||||
import org.linphone.utils.DialogUtils
|
||||
import androidx.core.net.toUri
|
||||
|
||||
@UiThread
|
||||
class HelpFragment : GenericMainFragment() {
|
||||
|
|
@ -78,7 +78,7 @@ class HelpFragment : GenericMainFragment() {
|
|||
binding.setPrivacyPolicyClickListener {
|
||||
val url = getString(R.string.website_privacy_policy_url)
|
||||
try {
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, url.toUri())
|
||||
startActivity(browserIntent)
|
||||
} catch (ise: IllegalStateException) {
|
||||
Log.e(
|
||||
|
|
@ -90,7 +90,7 @@ class HelpFragment : GenericMainFragment() {
|
|||
binding.setLicensesClickListener {
|
||||
val url = getString(R.string.website_open_source_licences_usage_url)
|
||||
try {
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, url.toUri())
|
||||
startActivity(browserIntent)
|
||||
} catch (ise: IllegalStateException) {
|
||||
Log.e(
|
||||
|
|
@ -102,7 +102,7 @@ class HelpFragment : GenericMainFragment() {
|
|||
binding.setTranslateClickListener {
|
||||
val url = getString(R.string.website_translate_weblate_url)
|
||||
try {
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, url.toUri())
|
||||
startActivity(browserIntent)
|
||||
} catch (ise: IllegalStateException) {
|
||||
Log.e(
|
||||
|
|
@ -157,7 +157,7 @@ class HelpFragment : GenericMainFragment() {
|
|||
model.confirmEvent.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
try {
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, url.toUri())
|
||||
startActivity(browserIntent)
|
||||
} catch (ise: IllegalStateException) {
|
||||
Log.e(
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
package org.linphone.ui.main.sso.viewmodel
|
||||
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import androidx.annotation.UiThread
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.viewModelScope
|
||||
|
|
@ -42,6 +41,7 @@ import org.linphone.ui.GenericViewModel
|
|||
import org.linphone.utils.Event
|
||||
import org.linphone.utils.FileUtils
|
||||
import org.linphone.utils.TimestampUtils
|
||||
import androidx.core.net.toUri
|
||||
|
||||
class SingleSignOnViewModel : GenericViewModel() {
|
||||
companion object {
|
||||
|
|
@ -102,7 +102,7 @@ class SingleSignOnViewModel : GenericViewModel() {
|
|||
private fun singleSignOn() {
|
||||
Log.i("$TAG Fetch from issuer [$singleSignOnUrl]")
|
||||
AuthorizationServiceConfiguration.fetchFromIssuer(
|
||||
Uri.parse(singleSignOnUrl),
|
||||
singleSignOnUrl.toUri(),
|
||||
AuthorizationServiceConfiguration.RetrieveConfigurationCallback { serviceConfiguration, ex ->
|
||||
if (ex != null) {
|
||||
Log.e(
|
||||
|
|
@ -130,7 +130,7 @@ class SingleSignOnViewModel : GenericViewModel() {
|
|||
serviceConfiguration, // the authorization service configuration
|
||||
CLIENT_ID, // the client ID, typically pre-registered and static
|
||||
ResponseTypeValues.CODE, // the response_type value: we want a code
|
||||
Uri.parse(REDIRECT_URI) // the redirect URI to which the auth response is sent
|
||||
REDIRECT_URI.toUri() // the redirect URI to which the auth response is sent
|
||||
)
|
||||
|
||||
// Needed for SDK to be able to refresh the token, otherwise it will return
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ import org.linphone.LinphoneApplication.Companion.coreContext
|
|||
import org.linphone.R
|
||||
import org.linphone.compatibility.Compatibility
|
||||
import org.linphone.core.tools.Log
|
||||
import androidx.core.net.toUri
|
||||
|
||||
class FileUtils {
|
||||
enum class MimeType {
|
||||
|
|
@ -193,7 +194,7 @@ class FileUtils {
|
|||
)
|
||||
}
|
||||
path.startsWith("content://") -> {
|
||||
contentUri = Uri.parse(path)
|
||||
contentUri = path.toUri()
|
||||
}
|
||||
else -> {
|
||||
val file = File(path)
|
||||
|
|
@ -209,7 +210,7 @@ class FileUtils {
|
|||
R.string.file_provider
|
||||
)}: $e"
|
||||
)
|
||||
Uri.parse(path)
|
||||
path.toUri()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@ import android.graphics.PorterDuff
|
|||
import android.graphics.PorterDuffXfermode
|
||||
import android.graphics.Rect
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.net.Uri
|
||||
import androidx.annotation.AnyThread
|
||||
import androidx.annotation.WorkerThread
|
||||
import java.io.FileNotFoundException
|
||||
import org.linphone.contacts.AvatarGenerator
|
||||
import org.linphone.core.tools.Log
|
||||
import androidx.core.net.toUri
|
||||
|
||||
class ImageUtils {
|
||||
companion object {
|
||||
|
|
@ -63,7 +63,7 @@ class ImageUtils {
|
|||
Log.d("$TAG Trying to create Bitmap from path [$path]")
|
||||
if (path != null) {
|
||||
try {
|
||||
val fromPictureUri = Uri.parse(path)
|
||||
val fromPictureUri = path.toUri()
|
||||
if (fromPictureUri == null) {
|
||||
Log.e("$TAG Failed to parse path [$path] as URI")
|
||||
return null
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue