Gallery2: camera: Invoke camera UI functions only after initialization.
When switching from Panorama mode to Camera mode, the CameraActivity invokes two functions openModule and onOrientationChanged. openModule initializes PhotoModule. As part of the PhotoModule initialization, the PhotoUI and PhotoMenu are initialized. But this is acheived by posting a message to the handler. When the message is read by the Handler, the PhotoUI's onCameraOpen is invoked which initializes the PhotoMenu. But sometimes before this message is read by the Handler, the onOrientationChanged is invoked, which invokes couple of functions from PhotoUI class acting on the PhotoMenu. But since the PhotoMenu is still not initialized, it throws up error in the form of NullPointerExceptions. Fix this by checking if the PhotoUI and PhotoMenu have been initialized. If they have not yet been initialized, send a message to the Handler to invoke these PhotoUI functionalities after the PhotoUI has been initialized completely. CRs-Fixed: 519055 Change-Id: I06ea54aa56da96459db6cacea92b02d0f8c23bcd
Loading
Please register or sign in to comment