Update ringtone uri
This commit is contained in:
parent
f514953da3
commit
f3cf77999e
|
@ -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')
|
||||||
|
|
Loading…
Reference in New Issue