diff --git a/app/src/org/commcare/activities/DrawActivity.java b/app/src/org/commcare/activities/DrawActivity.java index 3d9ab8a5b2..66292aae5a 100644 --- a/app/src/org/commcare/activities/DrawActivity.java +++ b/app/src/org/commcare/activities/DrawActivity.java @@ -23,6 +23,7 @@ import android.widget.RelativeLayout; import org.commcare.dalvik.R; +import org.commcare.util.LogTypes; import org.commcare.utils.FileUtil; import org.commcare.utils.MediaUtil; import org.commcare.utils.StringUtils; @@ -30,6 +31,7 @@ import org.commcare.views.dialogs.PaneledChoiceDialog; import org.commcare.views.widgets.ImageWidget; import org.commcare.views.widgets.SignatureWidget; +import org.javarosa.core.services.Logger; import java.io.File; import java.io.FileNotFoundException; @@ -201,10 +203,13 @@ protected void onCreate(Bundle savedInstanceState) { private void saveAndClose() { try { + Logger.log(LogTypes.SOFT_ASSERT, "Attempting to save signature"); saveFile(output); setResult(AppCompatActivity.RESULT_OK); } catch (FileNotFoundException e) { e.printStackTrace(); + // We shouldn't have gotten a file not found exception since we're using ImageWidget.getTempFileForImageCapture. + Logger.log(LogTypes.TYPE_ERROR_DESIGN, "Couldn't save signature at " + output.toString() + " because of" + e.getMessage()); setResult(AppCompatActivity.RESULT_CANCELED); } this.finish(); @@ -215,6 +220,7 @@ private void saveFile(File f) throws FileNotFoundException { // apparently on 4.x, the orientation change notification can occur // sometime before the view is rendered. In that case, the view // dimensions will not be known. + Logger.log(LogTypes.TYPE_ERROR_ASSERTION, "Found 0 width or height of view while saving signature"); Log.e(t, "view has zero width or zero height"); } else { FileOutputStream fos; diff --git a/app/src/org/commcare/activities/FormEntryActivity.java b/app/src/org/commcare/activities/FormEntryActivity.java index 3d7479f1ee..55bbece3ad 100644 --- a/app/src/org/commcare/activities/FormEntryActivity.java +++ b/app/src/org/commcare/activities/FormEntryActivity.java @@ -332,6 +332,7 @@ public void onActivityResultSessionSafe(int requestCode, int resultCode, Intent ImageCaptureProcessing.processCaptureResponse(this, FormEntryInstanceState.getInstanceFolder(), true); break; case FormEntryConstants.SIGNATURE_CAPTURE: + Logger.log(LogTypes.SOFT_ASSERT, "Signature captured successfully"); boolean saved = ImageCaptureProcessing.processCaptureResponse(this, FormEntryInstanceState.getInstanceFolder(), false); if (saved && !uiController.questionsView.isQuestionList()) { // attempt to auto-advance if a signature was captured