33import java .io .File ;
44import java .io .IOException ;
55
6+ import com .github .fielddb .BuildConfig ;
67import com .github .fielddb .Config ;
78import com .github .fielddb .R ;
89
@@ -148,10 +149,10 @@ public static Camera getCameraInstance() throws IOException {
148149 @ SuppressLint ("NewApi" )
149150 protected void beginRecording (SurfaceHolder holder ) throws IOException {
150151 if (this .mVideoRecorder != null ) {
151- if (Config . D )
152+ if (BuildConfig . DEBUG )
152153 Log .d (Config .TAG , "mVideoRecorder was not null. " );
153154 if (this .mRecording ) {
154- if (Config . D )
155+ if (BuildConfig . DEBUG )
155156 Log .d (Config .TAG , "Telling mVideoRecorder to stop before we start. " );
156157 this .mVideoRecorder .stop ();
157158 }
@@ -167,7 +168,7 @@ protected void beginRecording(SurfaceHolder holder) throws IOException {
167168 try {
168169 this .mCamera = getCameraInstance ();
169170 if (this .mCamera == null ) {
170- if (Config . D )
171+ if (BuildConfig . DEBUG )
171172 Log .e (Config .TAG , "There was a problem opening the camera. " );
172173 // TODO email devs?
173174 this .beginRecordingAudio ();
@@ -185,14 +186,14 @@ protected void beginRecording(SurfaceHolder holder) throws IOException {
185186 int sdk = android .os .Build .VERSION .SDK_INT ;
186187 if (sdk > 7 ) {
187188 if (cameraNumberUsed == -1 ) {
188- if (Config . D )
189+ if (BuildConfig . DEBUG )
189190 Log .e (Config .TAG , "This appears to have no camera set, trying another resolution." );
190191 this .mVideoRecorder .setProfile (CamcorderProfile .get (CamcorderProfile .QUALITY_HIGH ));
191192 } else {
192193 this .mVideoRecorder .setProfile (CamcorderProfile .get (cameraNumberUsed , CamcorderProfile .QUALITY_HIGH ));
193194 }
194195 } else {
195- if (Config . D )
196+ if (BuildConfig . DEBUG )
196197 Log .e (Config .TAG , "This appears to be android 2.1, trying to set the audio and video manually." );
197198 this .mVideoRecorder .setOutputFormat (MediaRecorder .OutputFormat .MPEG_4 );
198199 this .mVideoRecorder .setAudioEncoder (MediaRecorder .AudioEncoder .DEFAULT );
@@ -211,7 +212,7 @@ protected void beginRecording(SurfaceHolder holder) throws IOException {
211212 this .mVideoRecorder .start ();
212213 this .mRecording = true ;
213214 } catch (Exception e ) {
214- if (Config . D )
215+ if (BuildConfig . DEBUG )
215216 Log .e (Config .TAG , "There was a problem with the camera " + e .toString ());
216217 this .mRecording = false ;
217218 this .beginRecordingAudio ();
@@ -233,12 +234,12 @@ public void beginRecordingAudio() {
233234
234235 @ Override
235236 protected String doInBackground (Void ... params ) {
236- if (Config . D )
237+ if (BuildConfig . DEBUG )
237238 Log .v (Config .TAG , " doInBackground" );
238239 try {
239240 this .beginRecording (this .holder );
240241 } catch (Exception e ) {
241- if (Config . D )
242+ if (BuildConfig . DEBUG )
242243 Log .e (Config .TAG , "Error calling begin recording " + e .toString ());
243244 return "error recording video." ;
244245 }
@@ -259,7 +260,7 @@ public Activity getParentUI() {
259260
260261 @ Override
261262 protected void onPostExecute (String result ) {
262- if (Config . D )
263+ if (BuildConfig . DEBUG )
263264 Log .v (Config .TAG , " onPostExecute " + result );
264265 if (result .startsWith ("error" )) {
265266 this .beginRecordingAudio ();
@@ -268,7 +269,7 @@ protected void onPostExecute(String result) {
268269
269270 @ Override
270271 protected void onPreExecute () {
271- if (Config . D )
272+ if (BuildConfig . DEBUG )
272273 Log .v (Config .TAG , " onPreExecute" );
273274
274275 /*
@@ -284,7 +285,7 @@ protected void onPreExecute() {
284285 }
285286 (new File (this .mVideoResultsFile ).getParentFile ()).mkdirs ();
286287
287- if (Config . D )
288+ if (BuildConfig . DEBUG )
288289 Log .d (Config .TAG , "mVideoResultsFile " + this .mVideoResultsFile );
289290 }
290291
@@ -303,7 +304,7 @@ public void setParentUI(Activity mParentUI) {
303304 public void stopRecording () throws Exception {
304305 if (this .mVideoRecorder != null ) {
305306 if (this .mRecording ) {
306- if (Config . D )
307+ if (BuildConfig . DEBUG )
307308 Log .d (Config .TAG , "We are recording. Telling mVideoRecorder to stop. " );
308309 }
309310 this .mVideoRecorder .stop ();
0 commit comments