Aperture: Don't update thumbnail on ERROR_NO_VALID_DATA
Test: Double tap video recorder shutter with shutter sounds enabled.
Change-Id: I732ba4f9d89e6742db48294b520b0bce255f4c25
diff --git a/app/src/main/java/org/lineageos/aperture/MainActivity.kt b/app/src/main/java/org/lineageos/aperture/MainActivity.kt
index 4c20759..8b18433 100644
--- a/app/src/main/java/org/lineageos/aperture/MainActivity.kt
+++ b/app/src/main/java/org/lineageos/aperture/MainActivity.kt
@@ -560,11 +560,13 @@
recordChip.isVisible = false
}
cameraSoundsUtils.playStopVideoRecording()
- val msg = "Video capture succeeded: ${it.outputResults.outputUri}"
- sharedPreferences.lastSavedUri = it.outputResults.outputUri
- updateGalleryButton(it.outputResults.outputUri)
- Log.d(LOG_TAG, msg)
- tookSomething = true
+ if (it.error != VideoRecordEvent.Finalize.ERROR_NO_VALID_DATA) {
+ val msg = "Video capture succeeded: ${it.outputResults.outputUri}"
+ sharedPreferences.lastSavedUri = it.outputResults.outputUri
+ updateGalleryButton(it.outputResults.outputUri)
+ Log.d(LOG_TAG, msg)
+ tookSomething = true
+ }
recording = null
}
}