Update linked devices screen.

This commit is contained in:
Michelle Tang
2024-06-05 17:17:03 -07:00
committed by Alex Hart
parent 5c181e774f
commit ac52b5b992
21 changed files with 911 additions and 11 deletions

View File

@@ -210,13 +210,7 @@ object DateUtils : android.text.format.DateUtils() {
return if (isSameDay(System.currentTimeMillis(), timestamp)) {
context.getString(R.string.DeviceListItem_today)
} else {
val format: String = when {
timestamp.isWithin(6.days) -> "EEE "
timestamp.isWithin(365.days) -> "MMM d"
else -> "MMM d, yyy"
}
timestamp.toDateString(format, locale)
timestamp.toDateString("dd/MM/yy", locale)
}
}

View File

@@ -129,6 +129,7 @@ public final class FeatureFlags {
private static final String RESTORE_POST_REGISTRATION = "android.registration.restorePostRegistration";
private static final String LIBSIGNAL_WEB_SOCKET_SHADOW_PCT = "android.libsignalWebSocketShadowingPercentage";
private static final String DELETE_SYNC_SEND_RECEIVE = "android.deleteSyncSendReceive";
private static final String LINKED_DEVICES_V2 = "android.linkedDevices.v2";
/**
* We will only store remote values for flags in this set. If you want a flag to be controllable
@@ -211,7 +212,7 @@ public final class FeatureFlags {
);
@VisibleForTesting
static final Set<String> NOT_REMOTE_CAPABLE = SetUtil.newHashSet(MESSAGE_BACKUPS, REGISTRATION_V2, RESTORE_POST_REGISTRATION);
static final Set<String> NOT_REMOTE_CAPABLE = SetUtil.newHashSet(MESSAGE_BACKUPS, REGISTRATION_V2, RESTORE_POST_REGISTRATION, LINKED_DEVICES_V2);
/**
* Values in this map will take precedence over any value. This should only be used for local
@@ -750,6 +751,11 @@ public final class FeatureFlags {
return getBoolean(DELETE_SYNC_SEND_RECEIVE, false);
}
/** Whether or not to use V2 of linked devices. */
public static boolean linkedDevicesV2() {
return getBoolean(LINKED_DEVICES_V2, false);
}
/** Only for rendering debug info. */
public static synchronized @NonNull Map<String, Object> getMemoryValues() {
return new TreeMap<>(REMOTE_VALUES);