Haven is for people who need a way to protect their personal spaces and possessions without compromising their own privacy, through an Android app and on-device sensors
Lint: replace == with equals() for string comparison
fattire9e9dd2ba1b07
diff --git a/src/main/java/org/havenapp/main/service/MonitorService.java b/src/main/java/org/havenapp/main/service/MonitorService.javaindex b8c975d..154e509 100644--- a/src/main/java/org/havenapp/main/service/MonitorService.java+++ b/src/main/java/org/havenapp/main/service/MonitorService.java@@ -225,7 +225,7 @@ public class MonitorService extends Service {{mIsRunning = true;- if (mPrefs.getAccelerometerSensitivity() != PreferenceManager.OFF) {+ if (!mPrefs.getAccelerometerSensitivity().equals(PreferenceManager.OFF)) {mAccelManager = new AccelerometerMonitor(this);if(Build.VERSION.SDK_INT>=18) {mBumpMonitor = new BumpMonitor(this);@@ -236,7 +236,7 @@ public class MonitorService extends Service {mBaroMonitor = new BarometerMonitor(this);mLightMonitor = new AmbientLightMonitor(this);- if (mPrefs.getMicrophoneSensitivity() != PreferenceManager.OFF)+ if (!mPrefs.getMicrophoneSensitivity().equals(PreferenceManager.OFF))mMicMonitor = new MicrophoneMonitor(this);@@ -248,7 +248,7 @@ public class MonitorService extends Service {//this will never be false:// -you can't use ==, != for string comparisons, use equals() instead// -Value is never set to OFF in the first place- if (mPrefs.getAccelerometerSensitivity() != PreferenceManager.OFF) {+ if (!mPrefs.getAccelerometerSensitivity().equals(PreferenceManager.OFF)) {mAccelManager.stop(this);if(Build.VERSION.SDK_INT>=18) {mBumpMonitor.stop(this);@@ -259,7 +259,7 @@ public class MonitorService extends Service {mBaroMonitor.stop(this);mLightMonitor.stop(this);- if (mPrefs.getMicrophoneSensitivity() != PreferenceManager.OFF)+ if (!mPrefs.getMicrophoneSensitivity().equals(PreferenceManager.OFF))mMicMonitor.stop(this);}diff --git a/src/main/java/org/havenapp/main/ui/CameraFragment.java b/src/main/java/org/havenapp/main/ui/CameraFragment.javaindex 4005f8f..e4ab2c6 100644--- a/src/main/java/org/havenapp/main/ui/CameraFragment.java+++ b/src/main/java/org/havenapp/main/ui/CameraFragment.java@@ -70,7 +70,7 @@ public final class CameraFragment extends Fragment {PreferenceManager prefs = new PreferenceManager(getActivity());- if (prefs.getCameraSensitivity() != PreferenceManager.OFF) {+ if (!prefs.getCameraSensitivity().equals(PreferenceManager.OFF)) {//Uncomment to see the camerapreview = new Preview(getActivity());