1 package com
.owncloud
.android
.authentication
;
3 import android
.app
.Activity
;
4 import android
.content
.SharedPreferences
;
5 import android
.preference
.PreferenceManager
;
7 import com
.owncloud
.android
.MainApp
;
9 public class PinCheck
extends Activity
{
11 private static Long timestamp
= 0l;
12 private static Long lastStart
= 0l;
13 private static int PINCODE_TIMEOUT
= 10000;
15 public static void setUnlockTimestamp() {
16 timestamp
= System
.currentTimeMillis();
19 public static boolean checkIfPinEntry(){
20 if ((System
.currentTimeMillis() - timestamp
) > PINCODE_TIMEOUT
&&
21 (System
.currentTimeMillis() - lastStart
) > PINCODE_TIMEOUT
){
22 SharedPreferences appPrefs
= PreferenceManager
.getDefaultSharedPreferences(MainApp
.getAppContext());
23 if (appPrefs
.getBoolean("set_pincode", false
)) {
24 lastStart
= System
.currentTimeMillis();