Verified Commit 1521cdd2 authored by akwizgran's avatar akwizgran

Move expiry date to TestingConstants.

parent 80561910
Pipeline #1488 passed with stage
in 13 minutes and 49 seconds
......@@ -244,6 +244,7 @@ android {
resValue "string", "app_package", "org.briarproject.briar.android"
resValue "string", "app_name", "Briar"
buildConfigField "String", "GitHash", "\"${getGitHash()}\""
buildConfigField "Long", "BuildTimestamp", "${System.currentTimeMillis()}L"
}
buildTypes {
......
......@@ -6,9 +6,5 @@ package org.briarproject.briar.android;
*/
public interface BriarApplication {
// This build expires on 31 December 2018
long EXPIRY_DATE = 1546214400 * 1000L;
AndroidComponent getApplicationComponent();
}
......@@ -33,4 +33,12 @@ public interface TestingConstants {
* intentionally.
*/
boolean PREVENT_SCREENSHOTS = !IS_DEBUG_BUILD;
/**
* Debug and beta builds expire after 90 days. Final release builds expire
* after 292 million years.
*/
long EXPIRY_DATE = IS_DEBUG_BUILD || IS_BETA_BUILD ?
BuildConfig.BuildTimestamp + 90 * 24 * 60 * 60 * 1000L :
Long.MAX_VALUE;
}
......@@ -28,7 +28,7 @@ import javax.inject.Inject;
import static java.util.logging.Level.INFO;
import static java.util.logging.Level.WARNING;
import static org.briarproject.briar.android.BriarApplication.EXPIRY_DATE;
import static org.briarproject.briar.android.TestingConstants.EXPIRY_DATE;
import static org.briarproject.briar.android.TestingConstants.IS_BETA_BUILD;
import static org.briarproject.briar.android.TestingConstants.IS_DEBUG_BUILD;
import static org.briarproject.briar.android.controller.BriarControllerImpl.DOZE_ASK_AGAIN;
......
......@@ -19,9 +19,7 @@ import java.util.logging.Logger;
import javax.inject.Inject;
import static org.briarproject.briar.android.BriarApplication.EXPIRY_DATE;
import static org.briarproject.briar.android.TestingConstants.IS_BETA_BUILD;
import static org.briarproject.briar.android.TestingConstants.IS_DEBUG_BUILD;
import static org.briarproject.briar.android.TestingConstants.EXPIRY_DATE;
public class SplashScreenActivity extends BaseActivity {
......@@ -62,8 +60,7 @@ public class SplashScreenActivity extends BaseActivity {
}
protected void startNextActivity() {
if ((IS_DEBUG_BUILD || IS_BETA_BUILD)
&& System.currentTimeMillis() >= EXPIRY_DATE) {
if (System.currentTimeMillis() >= EXPIRY_DATE) {
LOG.info("Expired");
startActivity(new Intent(this, ExpiredActivity.class));
} else {
......
......@@ -46,7 +46,7 @@ import static android.text.format.DateUtils.FORMAT_SHOW_DATE;
import static android.text.format.DateUtils.MINUTE_IN_MILLIS;
import static android.text.format.DateUtils.WEEK_IN_MILLIS;
import static org.briarproject.briar.BuildConfig.APPLICATION_ID;
import static org.briarproject.briar.android.BriarApplication.EXPIRY_DATE;
import static org.briarproject.briar.android.TestingConstants.EXPIRY_DATE;
@MethodsNotNullByDefault
@ParametersNotNullByDefault
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment