summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNBruderman <nbruderman@gmail.com>2015-06-11 15:08:49 +0300
committerMichael Bestas <mkbestas@lineageos.org>2019-12-11 20:06:32 +0200
commit942adab87bd2239c11f98dbc72658ec92263f8b5 (patch)
treed1e7c0e19e425588a3be305cb67005ac6709013f
parent7014deeb8f2a8a5dcea37a01ebf51dd8eabd5bd4 (diff)
downloadandroid_packages_apps_Camera2-942adab87bd2239c11f98dbc72658ec92263f8b5.tar.gz
android_packages_apps_Camera2-942adab87bd2239c11f98dbc72658ec92263f8b5.tar.bz2
android_packages_apps_Camera2-942adab87bd2239c11f98dbc72658ec92263f8b5.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 eed425c29..d60979327 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -1352,7 +1352,8 @@ public class CameraActivity extends QuickActivity
private void removeItemAt(int index) {
mDataAdapter.removeAt(index);
- if (mDataAdapter.getTotalNumber() > 0) {
+ final int placeholders = mSecureCamera ? 1 : 0;
+ if (mDataAdapter.getTotalNumber() > placeholders) {
showUndoDeletionBar();
} else {
// If camera preview is the only view left in filmstrip,