diff --git a/wallet/src/de/schildbach/wallet/WalletApplication.java b/wallet/src/de/schildbach/wallet/WalletApplication.java index fad8cc6039..f6eb520d5c 100644 --- a/wallet/src/de/schildbach/wallet/WalletApplication.java +++ b/wallet/src/de/schildbach/wallet/WalletApplication.java @@ -67,6 +67,7 @@ import android.net.Uri; import android.os.Build; import android.os.StrictMode; +import android.os.SystemClock; import android.preference.PreferenceManager; import android.support.annotation.StringRes; import android.support.multidex.MultiDexApplication; @@ -632,7 +633,9 @@ else if (lastUsedAgo < Constants.LAST_USAGE_THRESHOLD_RECENTLY_MS) public void lockWalletIfNeeded() { WalletLock walletLock = WalletLock.getInstance(); - if (walletLock.isWalletLocked(wallet)) { + boolean recentReboot = SystemClock.elapsedRealtime() < WalletLock.DEFAULT_LOCK_TIMER_MILLIS && + config.getLastUnlockTime() < (System.currentTimeMillis() - SystemClock.elapsedRealtime()); + if (walletLock.isWalletLocked(wallet) || recentReboot) { walletLock.setWalletLocked(true); } } @@ -675,10 +678,4 @@ public void killAllActivities() { AbstractWalletActivity.finishAll(this); } - public static void resetWalletLockTimer(final Context context) { - final Configuration config = new Configuration(PreferenceManager.getDefaultSharedPreferences(context), - context.getResources()); - config.setLastUnlockTime(0); - } - } diff --git a/wallet/src/de/schildbach/wallet/service/BootstrapReceiver.java b/wallet/src/de/schildbach/wallet/service/BootstrapReceiver.java index fe7cf34fe6..b266b32dbd 100644 --- a/wallet/src/de/schildbach/wallet/service/BootstrapReceiver.java +++ b/wallet/src/de/schildbach/wallet/service/BootstrapReceiver.java @@ -56,8 +56,6 @@ public void onReceive(final Context context, final Intent intent) { if (config.remindBalance() && config.hasBeenUsed() && config.getLastUsedAgo() > Constants.LAST_USAGE_THRESHOLD_INACTIVE_MS) InactivityNotificationService.startMaybeShowNotification(context); - - WalletApplication.resetWalletLockTimer(context); } } }