Fixed NullPointerException during Cursor reuse

Every time an image is selected, CursorPhotoSource.naturalNext()
and naturalPrevious() functions are called to find the next/previous
images. Those functions check if a cursor which is associated with
an ImageData exists and is opened. If the cursor isn't opened then an
attempt to open a cursor is made.

The problem is that when a new ImageData is constructed inside
naturalNext() or naturalPrevious() functions, it shares the Cursor with
the currently selected image.
Later on, one of the ImageData objects closes the cursor which forces
other ImageData's to reopen it. However since uri wasn't set, null
pointer exception occurs.

Fixed by setting uri on newly created ImageData.

Bug: 28054525

Change-Id: I9ebad683089f872299343572f1df4dc7cc4ae628
1 file changed
tree: 828620d9aedb84ab5e252f97d27521660df21c6d
  1. res/
  2. src/
  3. Android.mk
  4. AndroidManifest.xml