mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-14 23:18:43 +00:00
Show linked deviceId's for internal users.
This commit is contained in:
@@ -448,7 +448,7 @@ fun DeviceListScreen(
|
||||
)
|
||||
} else {
|
||||
state.devices.forEach { device ->
|
||||
DeviceRow(device, onDeviceSelectedForRemoval, onEditDevice)
|
||||
DeviceRow(device, state.isInternalUser, onDeviceSelectedForRemoval, onEditDevice)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -492,7 +492,7 @@ fun DeviceListScreen(
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun DeviceRow(device: Device, setDeviceToRemove: (Device) -> Unit, onEditDevice: (Device) -> Unit) {
|
||||
fun DeviceRow(device: Device, isInternalUser: Boolean, setDeviceToRemove: (Device) -> Unit, onEditDevice: (Device) -> Unit) {
|
||||
val titleString = if (device.name.isNullOrEmpty()) stringResource(R.string.DeviceListItem_unnamed_device) else device.name
|
||||
val linkedDate = device.createdMillis?.let { DateUtils.getDayPrecisionTimeSpanString(LocalContext.current, Locale.getDefault(), device.createdMillis) }
|
||||
val lastActive = DateUtils.getDayPrecisionTimeSpanString(LocalContext.current, Locale.getDefault(), device.lastSeenMillis)
|
||||
@@ -523,6 +523,9 @@ fun DeviceRow(device: Device, setDeviceToRemove: (Device) -> Unit, onEditDevice:
|
||||
.weight(1f)
|
||||
) {
|
||||
Text(text = titleString, style = MaterialTheme.typography.bodyLarge)
|
||||
if (isInternalUser) {
|
||||
Text("[Internal] DeviceId: ${device.id}", style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)
|
||||
}
|
||||
if (linkedDate != null) {
|
||||
Text(stringResource(R.string.DeviceListItem_linked_s, linkedDate), style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)
|
||||
}
|
||||
|
||||
@@ -21,7 +21,8 @@ data class LinkDeviceSettingsState(
|
||||
val bottomSheetVisible: Boolean = false,
|
||||
val deviceToEdit: Device? = null,
|
||||
val shouldCancelArchiveUpload: Boolean = false,
|
||||
val debugLogUrl: String? = null
|
||||
val debugLogUrl: String? = null,
|
||||
val isInternalUser: Boolean = false
|
||||
) {
|
||||
sealed interface DialogState {
|
||||
data object None : DialogState
|
||||
|
||||
@@ -23,6 +23,7 @@ import org.thoughtcrime.securesms.linkdevice.LinkDeviceSettingsState.OneTimeEven
|
||||
import org.thoughtcrime.securesms.linkdevice.LinkDeviceSettingsState.QrCodeState
|
||||
import org.thoughtcrime.securesms.logsubmit.SubmitDebugLogRepository
|
||||
import org.thoughtcrime.securesms.notifications.NotificationIds
|
||||
import org.thoughtcrime.securesms.util.RemoteConfig
|
||||
import org.thoughtcrime.securesms.util.ServiceUtil
|
||||
import org.thoughtcrime.securesms.util.Util
|
||||
import org.whispersystems.signalservice.api.link.TransferArchiveError
|
||||
@@ -39,7 +40,7 @@ class LinkDeviceViewModel : ViewModel() {
|
||||
val TAG = Log.tag(LinkDeviceViewModel::class)
|
||||
}
|
||||
|
||||
private val _state = MutableStateFlow(LinkDeviceSettingsState())
|
||||
private val _state = MutableStateFlow(LinkDeviceSettingsState(isInternalUser = RemoteConfig.internalUser))
|
||||
val state = _state.asStateFlow()
|
||||
private val submitDebugLogRepository: SubmitDebugLogRepository = SubmitDebugLogRepository()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user