summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Mertz <scott@cyngn.com>2016-05-12 16:52:42 -0700
committerChippa-a <vusal1372@gmail.com>2019-10-25 15:55:25 +0300
commit75a4f13ae7c7f979af526cd7e2c1c43440cfa545 (patch)
tree5d96bd2ef6432027cd7c0ba0ade281470e4c3837
parent537860a47f79306d7d4deda8d4a8f8c23e461552 (diff)
downloadandroid_packages_apps_Snap-75a4f13ae7c7f979af526cd7e2c1c43440cfa545.tar.gz
android_packages_apps_Snap-75a4f13ae7c7f979af526cd7e2c1c43440cfa545.tar.bz2
android_packages_apps_Snap-75a4f13ae7c7f979af526cd7e2c1c43440cfa545.zip
CameraNext: stop updating the pano progress bar on pause
Fixes a NPE if a panorama is rendering when the user pauses the activity, then launches the camera from the lockscreen and enters panorama mode. With this patch, the user is shown a message "previous panorama is rendering" instead of the progress bar. FEIJ-533 Change-Id: I3247e4bd96aa3aa67e9b1ff75d747d8be0c3c633
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java
index 903469e10..9386e9371 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -707,13 +707,21 @@ public class WideAnglePanoramaModule
} catch (InterruptedException e) {
throw new RuntimeException("Panorama reportProgress failed", e);
}
- // Update the progress bar
- mActivity.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- mUI.updateSavingProgress(progress);
- }
- });
+ // Update the progress bar if we haven't paused. In the case where
+ // we pause the UI, then launch the camera from the lockscreen with
+ // this thread still running, a new WideAnglePanoramaModule is
+ // created, but this thread is left running to finish the task (and
+ // mPaused continues to be true for that instance.
+ if (!mPaused) {
+ mActivity.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ if (!mPaused) {
+ mUI.updateSavingProgress(progress);
+ }
+ }
+ });
+ }
}
}
};