OSDN Git Service

Restore activity lifecycle when OneCameraManager fails to initialize
authorAlan Newberger <alann@google.com>
Fri, 19 Dec 2014 21:09:03 +0000 (13:09 -0800)
committerAlan Newberger <alann@google.com>
Fri, 19 Dec 2014 22:26:15 +0000 (14:26 -0800)
commit4540b9fd5af80bd9508cb56f526560a38780b186
treebf9100a99f5706bad234f052394f7eeaa0cc26ab
parent48fbf15e2c8806fc518f4c881ab17b1b548887d9
Restore activity lifecycle when OneCameraManager fails to initialize

The return in onCreateTasks when OneCameraManager catches an exception, cause
camera crashes instead of showing the failure dialog as intended. The exception
is an NPE in PanoramaViewHelper but is due to assumptions of things init'ed
in onCreate not holding due to the return when onStart is executed. While we
could proof out every object to assume lifecycle events exit, I prefer to
maintain lifecycle and remove the return, and make anything that relies on
OneCameraManager know that it could be null. This also moves the handling of the
error dialog down to CaptureModule, in the unlikely case an API1 module would
still work this enables it while preserving the same intended behavior for
CaptureModule.

Bug: 18048591
Change-Id: Ib81f8b42eaa26daae2d3354bae1ef5127a9cbcf1
src/com/android/camera/CameraActivity.java
src/com/android/camera/CaptureModule.java