From b0e6afd9beb2781fac489663c7a3921c28aa2fa9 Mon Sep 17 00:00:00 2001 From: NBruderman Date: Thu, 11 Jun 2015 15:08:49 +0300 Subject: Snap: 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 --- src/com/android/camera/CameraActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java index 39c80bb84..e7d66e7f6 100755 --- a/src/com/android/camera/CameraActivity.java +++ b/src/com/android/camera/CameraActivity.java @@ -1343,7 +1343,8 @@ public class CameraActivity extends Activity private void removeData(int dataID) { mDataAdapter.removeData(CameraActivity.this, dataID); - 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, -- cgit v1.2.3