summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNBruderman <nbruderman@gmail.com>2015-06-11 15:08:49 +0300
committerMichael Bestas <mikeioannina@gmail.com>2016-12-30 17:21:21 +0200
commit68c315b220a5abd7c754592369ab349888fb1779 (patch)
tree6c7e186bb709e181253b52dba46a930a51daee20
parentf9696408c977c55ce7f7d6b7a0738d2af834eab5 (diff)
downloadandroid_packages_apps_Camera2-68c315b220a5abd7c754592369ab349888fb1779.tar.gz
android_packages_apps_Camera2-68c315b220a5abd7c754592369ab349888fb1779.tar.bz2
android_packages_apps_Camera2-68c315b220a5abd7c754592369ab349888fb1779.zip
Camera2: Fix Undo button behaviour
The undo behaviour depends on if the camera present secure settings or not. If secure, it should have 1 placeholder. 0 in other cases. Repro (for non secure cameras): 1. Leave only 3 pictures on the album. 2. Delete one picture, it will work fine. 3. Leave only 2 pictures on the album. 4. Try to delete, and you will go straight to the camera, without the undo pannel showing up. Change-Id: I360076381867a74628ffa492065ccf2ca53c72d6
-rw-r--r--src/com/android/camera/CameraActivity.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index a5bf0d747..18c4237db 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -1353,7 +1353,8 @@ public class CameraActivity extends QuickActivity
private void removeItemAt(int index) {
mDataAdapter.removeAt(index);
- if (mDataAdapter.getTotalNumber() > 1) {
+ final int placeholders = mSecureCamera ? 1 : 0;
+ if (mDataAdapter.getTotalNumber() > placeholders) {
showUndoDeletionBar();
} else {
// If camera preview is the only view left in filmstrip,