From c403df0e209899b9e8f9773641623eba97e83724 Mon Sep 17 00:00:00 2001 From: akwizgran <akwizgran@users.sourceforge.net> Date: Sun, 5 Jan 2014 21:53:32 +0000 Subject: [PATCH] Check the expiry date on first run. Fixes bug #35. --- .../sf/briar/android/HomeScreenActivity.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/briar-android/src/net/sf/briar/android/HomeScreenActivity.java b/briar-android/src/net/sf/briar/android/HomeScreenActivity.java index b1863b1b6a..abb071099c 100644 --- a/briar-android/src/net/sf/briar/android/HomeScreenActivity.java +++ b/briar-android/src/net/sf/briar/android/HomeScreenActivity.java @@ -89,15 +89,19 @@ public class HomeScreenActivity extends RoboActivity { long handle = i.getLongExtra("net.sf.briar.LOCAL_AUTHOR_HANDLE", -1); if(handle != -1) { // The activity was launched from the setup wizard - showSpinner(); - startService(new Intent(BriarService.class.getName())); - bindService(); - LocalAuthor a = referenceManager.removeReference(handle, - LocalAuthor.class); - // The reference may be null if the activity has been recreated, - // for example due to screen rotation - if(a == null) showButtons(); - else storeLocalAuthor(a); + if(System.currentTimeMillis() < EXPIRY_DATE) { + showSpinner(); + startService(new Intent(BriarService.class.getName())); + bindService(); + LocalAuthor a = referenceManager.removeReference(handle, + LocalAuthor.class); + // The reference may be null if the activity has been recreated, + // for example due to screen rotation + if(a == null) showButtons(); + else storeLocalAuthor(a); + } else { + showExpiryWarning(); + } } else if(databaseConfig.getEncryptionKey() == null) { // The activity was launched from the splash screen if(System.currentTimeMillis() < EXPIRY_DATE) showPasswordPrompt(); -- GitLab