Skip to content

armgit / haven

Public Imported from GitHub
0

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

for #19 reduce framerate of preview, should help with battery

n8fr8c5a95bae3db2
diff --git a/src/main/java/info/guardianproject/phoneypot/sensors/motion/Preview.java b/src/main/java/info/guardianproject/phoneypot/sensors/motion/Preview.java
index 8724dba..d45eb07 100644
--- a/src/main/java/info/guardianproject/phoneypot/sensors/motion/Preview.java
+++ b/src/main/java/info/guardianproject/phoneypot/sensors/motion/Preview.java
@@ -55,7 +55,7 @@ public class Preview extends SurfaceView implements SurfaceHolder.Callback {
private PreferenceManager prefs;
private int cameraFacing = 0;
- private final static long PREVIEW_INTERVAL = 2000;
+ private final static int PREVIEW_INTERVAL = 2000;
private List<MotionAsyncTask.MotionListener> listeners = new ArrayList<MotionAsyncTask.MotionListener>();
@@ -315,7 +315,7 @@ public class Preview extends SurfaceView implements SurfaceHolder.Callback {
// the preview.
Camera.Parameters parameters = camera.getParameters();
parameters.setPreviewSize(w, h);
-
+ parameters.setPreviewFpsRange(PREVIEW_INTERVAL,PREVIEW_INTERVAL*2);
int degree = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation();
int displayOrientation = 0;
switch (degree) {