Smart Control

Adds the ability to Play/Pause video by waving above the
screen using the proximity sensor.

Change-Id: I4da390171d788e01ae0c45f324b4f4678708ba64
Gallery2: if selected count is 0, leave selection mode.

If the selected count is 0, no need stay in selection
mode.

After we toggle a item, if selected count is 0，leave
the selection mode.

CRs-Fixed: 412492

Change-Id: Ia3ecd1c77f4074f21b1f906050b4a7bc2dc37c6e
Gallery2: force close happens when remove Gallery widget

The mSource may be null if we destroyed the widget.

So we make the function return null if we remove the
widget to make gallery avoid force closing.

CRs-Fixed: 362477

Change-Id: Ied227235f4dc78aeed69a70c264e523268c344d0
Gallery2: update selected number for database change

mSourceMediaSet will be updated for database changed
But mTotal will not if it is more than zero.

Update mTotal all the time for database changed

CRs-Fixed: 407961

Change-Id: I432b33ba62c04b18c6a1628b6b10dc9b77a72fc1
Gallery2: set the progress bar when we pause the video

The progress bar isn't set when we pause the video.

Set the progress bar when we pause the video

CRs-Fixed: BZ1623

Change-Id: I3d450df6fdf8195983692ed8a71ab42717e9c36c
Gallery2: dismiss delete-confirm dialog when pause

If user choose delete operation in camera page mode,
then a confirm dialog will show,then user pause and
resume from pause,will find the dialog still exists
in camera preview.

To prevent confusing user,we will change to dismiss
confirm dialog when pause.

CRs-Fixed: BZ737

Change-Id: Ib22cf78cc6c7e513208f57e502eaf0a4d1f50917
Gallery2: invalidate album view even only size changed

After deleting the pictures, it didn't request to
update the view. so the left pictures can not be
updated and displayed instantly.

Invalidate album view even only size changed to
make it shown correctly.

CRs-Fixed: 393995

Change-Id: I9924edf3a1d0e46d045425b9d078758e8cb50685
Gallery2: keep selection mode when deSelectAll

Origin code will call leaveSelectionMode function in
deSelectAll and will not keep in selected status on
this situation.

Add DESELECT_ALL_MODE in AlbumPage and
AlbumSetPage to make stay in selection mode even if
choose deSelectAll.

CRs-Fixed: 342469

Change-Id: Ia8819ba197444c33b1641ad33dd8602ecca0075c
Gallery2: request thumb if fail to get region decoder

When fail to get region decoder in SinglePhotoAdapter, try to
request thumb image rather than return null directly.

CRs-Fixed: 369231

Change-Id: I11fe4b4f3ac10550f10e0391a919c0ea18fe47e0
Gallery2: update time-cluster albums for database change

When in time clustering and picture/video added,the page
is not updated for current cluster album will ignore this
change.

We add to reload cluster albums on this solution,meanwhile
change time clustering method from dynamic to static which
makes same month and same year items into same cluster.

CRs-Fixed: 383896

Change-Id: I59b592d91c045290b4b2a0ff4279f5a95fa83706
Gallery2: update content start/end once getUpdateinfo

When viewing last picture in screenshot album and do screenshot, the
new picture will become the first one in album and the album has
changed, but this time current index and content start/end is still
old value, so user will find change to previous picture from current
one in current page.

To aviod this situation, will update content start and content end
once after getUpdateinfo and then can get correct current index and
item path.

CRs-Fixed: 420908

Change-Id: If0da8f8b2ea25d4aed9b8a73f6050e58aadae5de
Camera: Wrong count is displayed when view details for a video

mSource size is coming as 2 even if there is only one image due to
wrong initialization. Fixing that initializaiton may break other use cases.
So, the fix has been given only for this particular error (Wrong count).

Change-Id: I65117dd34d2ec80ca68e5a22e0403f5470e2621a
CRs-fixed: 514328
Gallery2: put a itemPath to the bundle when start photopage.

In some cases,  it request to start photopage, but
the deletions is not cleared, it get 0 when get
media item count, so it can not get a itemPath to
create a photodata adapter when create photopage,
then it request to finish state when resume, then a
NullPointerException happens.

We put a itemPath to the bundle when start photopage.
So it can create a photodata adapter, and do not finish
the photopage state.

CRs-Fixed: 521735

Change-Id: I539bcfa35db35fdf0fe9004470e7a77acc65a94d
Gallery2: fix save button is disabled after rotate in TrimVideo

After rotating the phone, TrimVideo activity will recreate,
the save button will be disabled when create activity.

We restore the state of the save button.

CRs-Fixed: 521010

Change-Id: Ided934a6e54b20289c21608f2df19875d25adb7d
Gallery2: force close happens on deleting MMS attachment

When open a MMS attached picture, zoom out and pull down,
force close happens for PhotoView doesn't support delete
single photo in SinglePhotoDataAdapter.

So we cut this delete function in SinglePhotoDataAdapter
to avoid NullPointerException in Gallery.

CRs-Fixed: 523924

Change-Id: I58baac9316cfbeba8509e118dd00c4f74d2a885c
Gallery2: update select title and menu in selectAll mode

If albumpage is in selectAll mode, and then
capture a new picture, the selected picture
become more, and the actionmode not been
updated, if tap edit, it throws an AssertionError.

When size changed and is in selectAll mode now,
we update the selected count and supported
operations.

CRs-Fixed: 510675

Change-Id: I77c4a23c327a1ce1bf5b822db23ac065563d1741
Gallery2: Fix detail dialog image count

This commit fixes the displayed image index which needs
to be count up by 1 to make sense for the user.

Before: http://goo.gl/BeRp8Z
After:  http://goo.gl/N3xvX6

Change-Id: Ib8d782188207d9ee7444316e8426b8215c67e594
Gallery2: Fix filmstrip source index

Filmstrip has 1 item more (the camera itself). Do not count the Camera as an item

Change-Id: I2027d857c08477cb0303e74c15818be1fc979104
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Gallery2: Clear undefined buffer before first draw

Clear undefined buffer before first draw.

Crs-fixed: 526603 523916
Change-Id: I1cfdb621bdcf08dc8994adddb0111a1aaf941f56
Gallery: Fix filmstrip source index

Change-Id: I0213871f47fb386ddce5728f0079eb7884e6d9d4
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>