Set default timer duration to 1 minute for testing.

This commit is contained in:
akwizgran
2021-02-25 15:58:28 +00:00
committed by Torsten Grote
parent e3c5497283
commit 3ecd1c62b8
2 changed files with 10 additions and 2 deletions

View File

@@ -62,7 +62,6 @@ import androidx.lifecycle.MutableLiveData;
import static androidx.lifecycle.Transformations.map; import static androidx.lifecycle.Transformations.map;
import static java.util.Objects.requireNonNull; import static java.util.Objects.requireNonNull;
import static java.util.concurrent.TimeUnit.DAYS;
import static java.util.logging.Level.INFO; import static java.util.logging.Level.INFO;
import static java.util.logging.Level.WARNING; import static java.util.logging.Level.WARNING;
import static java.util.logging.Logger.getLogger; import static java.util.logging.Logger.getLogger;
@@ -75,6 +74,7 @@ import static org.briarproject.briar.android.view.TextSendController.SendState.E
import static org.briarproject.briar.android.view.TextSendController.SendState.SENT; import static org.briarproject.briar.android.view.TextSendController.SendState.SENT;
import static org.briarproject.briar.android.view.TextSendController.SendState.UNEXPECTED_TIMER; import static org.briarproject.briar.android.view.TextSendController.SendState.UNEXPECTED_TIMER;
import static org.briarproject.briar.api.autodelete.AutoDeleteConstants.NO_AUTO_DELETE_TIMER; import static org.briarproject.briar.api.autodelete.AutoDeleteConstants.NO_AUTO_DELETE_TIMER;
import static org.briarproject.briar.api.autodelete.AutoDeleteManager.DEFAULT_TIMER_DURATION;
import static org.briarproject.briar.api.messaging.PrivateMessageFormat.TEXT_IMAGES; import static org.briarproject.briar.api.messaging.PrivateMessageFormat.TEXT_IMAGES;
import static org.briarproject.briar.api.messaging.PrivateMessageFormat.TEXT_ONLY; import static org.briarproject.briar.api.messaging.PrivateMessageFormat.TEXT_ONLY;
@@ -393,7 +393,7 @@ public class ConversationViewModel extends DbViewModel
} }
void setAutoDeleteTimerEnabled(boolean enabled) { void setAutoDeleteTimerEnabled(boolean enabled) {
final long timer = enabled ? DAYS.toMillis(7) : NO_AUTO_DELETE_TIMER; long timer = enabled ? DEFAULT_TIMER_DURATION : NO_AUTO_DELETE_TIMER;
// ContactId is set before menu gets inflated and UI interaction // ContactId is set before menu gets inflated and UI interaction
final ContactId c = requireNonNull(contactId); final ContactId c = requireNonNull(contactId);
runOnDbThread(() -> { runOnDbThread(() -> {

View File

@@ -6,6 +6,8 @@ import org.briarproject.bramble.api.db.Transaction;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault; import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.sync.ClientId; import org.briarproject.bramble.api.sync.ClientId;
import static java.util.concurrent.TimeUnit.MINUTES;
@NotNullByDefault @NotNullByDefault
public interface AutoDeleteManager { public interface AutoDeleteManager {
@@ -24,6 +26,12 @@ public interface AutoDeleteManager {
*/ */
int MINOR_VERSION = 0; int MINOR_VERSION = 0;
/**
* The default auto-delete timer duration.
* TODO: Change this to one week before release
*/
long DEFAULT_TIMER_DURATION = MINUTES.toMillis(1);
/** /**
* Returns the auto-delete timer duration for the given contact. Use * Returns the auto-delete timer duration for the given contact. Use
* {@link #getAutoDeleteTimer(Transaction, ContactId, long)} if the timer * {@link #getAutoDeleteTimer(Transaction, ContactId, long)} if the timer