Browse Source

Merge branch 'lukeswitz-switchCamera_fix'

n8fr8 7 months ago
parent
commit
594c4d80e7

+ 6 - 10
src/main/java/org/havenapp/main/sensors/media/MicSamplerTask.java

@@ -52,14 +52,13 @@ public class MicSamplerTask extends AsyncTask<Void,Object,Void> {
52 52
 		while (true) {
53 53
 
54 54
 			if (listener != null) {
55
-				Log.i("MicSamplerTask", "Requesting amplitude");
55
+				Log.d("MicSamplerTask", "Requesting amplitude");
56 56
 				publishProgress(volumeMeter.getAmplitude());
57 57
 			}
58 58
 			try {
59 59
 				Thread.sleep(250);
60 60
 			} catch (InterruptedException e) { 
61
-				//Nothing to do we exit next line 
62
-				
61
+				//Nothing to do we exit next line
63 62
 			}
64 63
 			
65 64
 			boolean restartVolumeMeter = false;
@@ -72,22 +71,19 @@ public class MicSamplerTask extends AsyncTask<Void,Object,Void> {
72 71
 				try {
73 72
 					Thread.sleep(500);
74 73
 				} catch (InterruptedException e) {
75
-					// TODO Auto-generated catch block
76
-					e.printStackTrace();
74
+					//Nothing to do we exit next line
77 75
 				}
78 76
 			}
79 77
 			if (restartVolumeMeter) {
80 78
 				try {
81
-					Log.i("MicSamplerTask", "Task restarted");
79
+					Log.d("MicSamplerTask", "Task restarted");
82 80
 					volumeMeter = new AudioCodec();
83 81
 					volumeMeter.start();
84 82
 					sampling = true;
85 83
 				} catch (IllegalStateException e) {
86
-					// TODO Auto-generated catch block
87
-					e.printStackTrace();
84
+					Log.d("MicSamplerTask","Failed to start",e);
88 85
 				} catch (IOException e) {
89
-					// TODO Auto-generated catch block
90
-					e.printStackTrace();
86
+					Log.d("MicSamplerTask","Failed to start",e);
91 87
 				}
92 88
 			}
93 89
 			if (isCancelled()) { volumeMeter.stop(); sampling = false; return null; }

+ 1 - 1
src/main/java/org/havenapp/main/ui/CameraConfigureActivity.java

@@ -101,7 +101,7 @@ public class CameraConfigureActivity extends AppCompatActivity {
101 101
         else if (camera.equals(PreferenceManager.BACK))
102 102
             mPrefManager.setCamera(PreferenceManager.FRONT);
103 103
 
104
-        ((CameraFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_camera)).updateCamera();
104
+        mFragment.updateCamera();
105 105
         setResult(RESULT_OK);
106 106
     }
107 107