Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / communicate-dev / src / main / java / com / vayunmathur / communicate / data / CommunicateLine.kt
CommunicateLine.kt53 lines · 1.6 KiBRaw
| 1 | package com.vayunmathur.communicate.data |
| 2 | |
| 3 | /** |
| 4 | * Which line a conversation, message, or call belongs to. The physical SIM is the |
| 5 | * default so every existing construction site (system-provider reads) stays valid; |
| 6 | * Google Voice rows are tagged explicitly when merged in by the repository. |
| 7 | */ |
| 8 | enum class CommunicateLine { |
| 9 | Sim, |
| 10 | GoogleVoice, |
| 11 | WhatsApp, |
| 12 | Signal, |
| 13 | Rcs, |
| 14 | } |
| 15 | |
| 16 | /** |
| 17 | * A selectable outgoing line for the line picker: a specific physical SIM (by subscription id) |
| 18 | * or Google Voice. Mirrors how the OS lets you pick which SIM to call/text from. |
| 19 | */ |
| 20 | sealed interface LineChoice { |
| 21 | val label: String |
| 22 | val category: CommunicateLine |
| 23 | |
| 24 | /** The physical SIM line identified by subscription id. */ |
| 25 | data class Sim(val subscriptionId: Int, override val label: String) : LineChoice { |
| 26 | override val category get() = CommunicateLine.Sim |
| 27 | } |
| 28 | |
| 29 | /** The Google Voice line. */ |
| 30 | data object GoogleVoice : LineChoice { |
| 31 | override val label = "Google Voice" |
| 32 | override val category get() = CommunicateLine.GoogleVoice |
| 33 | } |
| 34 | |
| 35 | /** The WhatsApp line. */ |
| 36 | data object WhatsApp : LineChoice { |
| 37 | override val label = "WhatsApp" |
| 38 | override val category get() = CommunicateLine.WhatsApp |
| 39 | } |
| 40 | |
| 41 | /** The Signal line. */ |
| 42 | data object Signal : LineChoice { |
| 43 | override val label = "Signal" |
| 44 | override val category get() = CommunicateLine.Signal |
| 45 | } |
| 46 | |
| 47 | /** The carrier RCS line. */ |
| 48 | data object Rcs : LineChoice { |
| 49 | override val label = "RCS" |
| 50 | override val category get() = CommunicateLine.Rcs |
| 51 | } |
| 52 | } |
| 53 |