From 6fcfa840b70dbf50867084beb853aa67e7edc806 Mon Sep 17 00:00:00 2001 From: ardevd Date: Wed, 2 May 2018 14:19:36 +0200 Subject: [PATCH] authentication:passcodemanager: Cleaned up variable naming. --- .../authentication/PassCodeManager.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/owncloud/android/authentication/PassCodeManager.java b/src/main/java/com/owncloud/android/authentication/PassCodeManager.java index 3e5f08d84c..20db2cda57 100644 --- a/src/main/java/com/owncloud/android/authentication/PassCodeManager.java +++ b/src/main/java/com/owncloud/android/authentication/PassCodeManager.java @@ -38,28 +38,28 @@ import java.util.Set; public class PassCodeManager { - private static final Set sExemptOfPasscodeActivites; + private static final Set exemptOfPasscodeActivities; static { - sExemptOfPasscodeActivites = new HashSet<>(); - sExemptOfPasscodeActivites.add(PassCodeActivity.class); - sExemptOfPasscodeActivites.add(FingerprintActivity.class); + exemptOfPasscodeActivities = new HashSet<>(); + exemptOfPasscodeActivities.add(PassCodeActivity.class); + exemptOfPasscodeActivities.add(FingerprintActivity.class); // other activities may be exempted, if needed } private static final int PASS_CODE_TIMEOUT = 1000; // keeping a "low" positive value is the easiest way to prevent the pass code is requested on rotations - private static PassCodeManager mPassCodeManagerInstance = null; + private static PassCodeManager passCodeManagerInstance = null; - private Long mTimestamp = 0l; - private int mVisibleActivitiesCounter = 0; + private Long timestamp = 0l; + private int visibleActivitiesCounter = 0; public static PassCodeManager getPassCodeManager() { - if (mPassCodeManagerInstance == null) { - mPassCodeManagerInstance = new PassCodeManager(); + if (passCodeManagerInstance == null) { + passCodeManagerInstance = new PassCodeManager(); } - return mPassCodeManagerInstance; + return passCodeManagerInstance; } protected PassCodeManager() {} @@ -73,7 +73,7 @@ public class PassCodeManager { } public void onActivityStarted(Activity activity) { - if (!sExemptOfPasscodeActivites.contains(activity.getClass()) && passCodeShouldBeRequested()) { + if (!exemptOfPasscodeActivities.contains(activity.getClass()) && passCodeShouldBeRequested()) { Intent i = new Intent(MainApp.getAppContext(), PassCodeActivity.class); i.setAction(PassCodeActivity.ACTION_CHECK); @@ -81,7 +81,7 @@ public class PassCodeManager { activity.startActivity(i); } - if (!sExemptOfPasscodeActivites.contains(activity.getClass()) && + if (!exemptOfPasscodeActivities.contains(activity.getClass()) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && fingerprintShouldBeRequested() && FingerprintActivity.isFingerprintReady(MainApp.getAppContext())) { @@ -91,12 +91,12 @@ public class PassCodeManager { activity.startActivity(i); } - mVisibleActivitiesCounter++; // keep it AFTER passCodeShouldBeRequested was checked + visibleActivitiesCounter++; // keep it AFTER passCodeShouldBeRequested was checked } public void onActivityStopped(Activity activity) { - if (mVisibleActivitiesCounter > 0) { - mVisibleActivitiesCounter--; + if (visibleActivitiesCounter > 0) { + visibleActivitiesCounter--; } setUnlockTimestamp(); PowerManager powerMgr = (PowerManager) activity.getSystemService(Context.POWER_SERVICE); @@ -106,11 +106,11 @@ public class PassCodeManager { } private void setUnlockTimestamp() { - mTimestamp = System.currentTimeMillis(); + timestamp = System.currentTimeMillis(); } private boolean passCodeShouldBeRequested() { - return (System.currentTimeMillis() - mTimestamp) > PASS_CODE_TIMEOUT && mVisibleActivitiesCounter <= 0 && passCodeIsEnabled(); + return (System.currentTimeMillis() - timestamp) > PASS_CODE_TIMEOUT && visibleActivitiesCounter <= 0 && passCodeIsEnabled(); } private boolean passCodeIsEnabled() { @@ -119,7 +119,7 @@ public class PassCodeManager { } private boolean fingerprintShouldBeRequested() { - return (System.currentTimeMillis() - mTimestamp) > PASS_CODE_TIMEOUT && mVisibleActivitiesCounter <= 0 && fingerprintIsEnabled(); + return (System.currentTimeMillis() - timestamp) > PASS_CODE_TIMEOUT && visibleActivitiesCounter <= 0 && fingerprintIsEnabled(); } private boolean fingerprintIsEnabled() {