Update ringtone uri

This commit is contained in:
Tlaster 2020-04-26 14:11:28 +08:00
parent f514953da3
commit f3cf77999e
1 changed files with 6 additions and 5 deletions

View File

@ -1,8 +1,9 @@
package org.mariotaku.twidere.extension.model package org.mariotaku.twidere.extension.model
import android.media.RingtoneManager
import android.net.Uri import android.net.Uri
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert import org.junit.Assert
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
@ -27,12 +28,12 @@ class DraftExtensionsTest {
draft.text = "Hello world 测试" draft.text = "Hello world 测试"
draft.location = ParcelableLocation(-11.956, 99.625) // Randomly generated draft.location = ParcelableLocation(-11.956, 99.625) // Randomly generated
draft.media = arrayOf( draft.media = arrayOf(
"file:///system/media/audio/ringtones/Atria.ogg", RingtoneManager.getActualDefaultRingtoneUri(context, RingtoneManager.TYPE_RINGTONE),
"file:///system/media/audio/ringtones/Callisto.ogg", RingtoneManager.getActualDefaultRingtoneUri(context, RingtoneManager.TYPE_NOTIFICATION),
"file:///system/media/audio/ringtones/Dione.ogg" RingtoneManager.getActualDefaultRingtoneUri(context, RingtoneManager.TYPE_ALARM)
).map { uri -> ).map { uri ->
ParcelableMediaUpdate().apply { ParcelableMediaUpdate().apply {
this.uri = uri this.uri = uri.toString()
this.type = ParcelableMedia.Type.VIDEO this.type = ParcelableMedia.Type.VIDEO
this.alt_text = String(CharArray(420).apply { this.alt_text = String(CharArray(420).apply {
fill('A') fill('A')