sms-translate/app/src/main/kotlin/com/simplemobiletools/smsmessenger/models/MmsAddress.kt
2021-09-18 16:14:58 +01:00

28 lines
788 B
Kotlin

package com.simplemobiletools.smsmessenger.models
import android.content.ContentValues
import android.provider.Telephony
import androidx.core.content.contentValuesOf
import com.google.gson.annotations.SerializedName
data class MmsAddress(
@SerializedName("address")
val address: String,
@SerializedName("msg_id")
val msgId: Int,
@SerializedName("type")
val type: Int,
@SerializedName("charset")
val charset: Int
) {
fun toContentValues(): ContentValues {
// msgId would be added at the point of insertion
// because it may have changed
return contentValuesOf(
Telephony.Mms.Addr.ADDRESS to address,
Telephony.Mms.Addr.TYPE to type,
Telephony.Mms.Addr.CHARSET to charset,
)
}
}