Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import android.content.Intent;
import android.os.Build;
import android.os.PowerManager;
import android.os.SystemClock;
import android.view.Window;
import android.view.WindowManager;

Expand Down Expand Up @@ -102,7 +103,7 @@ public boolean onActivityStarted(Activity activity) {
activity.startActivityForResult(i, PASSCODE_ACTIVITY);
} else {
if (!askedForPin && preferences.getLockTimestamp() != 0) {
preferences.setLockTimestamp(System.currentTimeMillis());
preferences.setLockTimestamp(SystemClock.elapsedRealtime());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.SystemClock;
import android.text.Html;
import android.view.Menu;
import android.view.MenuItem;
Expand Down Expand Up @@ -1421,7 +1422,7 @@ protected void onStart() {
@Override
protected void onStop() {
if (preferences.getLockTimestamp() != 0) {
preferences.setLockTimestamp(System.currentTimeMillis());
preferences.setLockTimestamp(SystemClock.elapsedRealtime());
}
EventBus.getDefault().unregister(this);
super.onStop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import android.content.Intent;
import android.graphics.PorterDuff;
import android.os.Bundle;
import android.os.SystemClock;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
Expand Down Expand Up @@ -240,7 +241,7 @@ private void processFullPassCode() {
if (ACTION_CHECK.equals(getIntent().getAction())) {
if (checkPassCode()) {
/// pass code accepted in request, user is allowed to access the app
AppPreferencesImpl.fromContext(this).setLockTimestamp(System.currentTimeMillis());
AppPreferencesImpl.fromContext(this).setLockTimestamp(SystemClock.elapsedRealtime());
hideSoftKeyboard();
finish();

Expand All @@ -250,7 +251,7 @@ private void processFullPassCode() {

} else if (ACTION_CHECK_WITH_RESULT.equals(getIntent().getAction())) {
if (checkPassCode()) {
AppPreferencesImpl.fromContext(this).setLockTimestamp(System.currentTimeMillis());
AppPreferencesImpl.fromContext(this).setLockTimestamp(SystemClock.elapsedRealtime());
Intent resultIntent = new Intent();
resultIntent.putExtra(KEY_CHECK_RESULT, true);
setResult(RESULT_OK, resultIntent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.SystemClock;
import android.widget.Toast;

import com.nextcloud.client.preferences.AppPreferencesImpl;
Expand Down Expand Up @@ -53,7 +54,7 @@ public class RequestCredentialsActivity extends Activity {
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_CODE_CONFIRM_DEVICE_CREDENTIALS) {
if (resultCode == Activity.RESULT_OK) {
AppPreferencesImpl.fromContext(this).setLockTimestamp(System.currentTimeMillis());
AppPreferencesImpl.fromContext(this).setLockTimestamp(SystemClock.elapsedRealtime());
finishWithResult(KEY_CHECK_RESULT_TRUE);
} else if (resultCode == Activity.RESULT_CANCELED) {
finishWithResult(KEY_CHECK_RESULT_CANCEL);
Expand Down