Fix resource leak: When call MediaMetadataRetriever.setDataSource or getFrameAtTime should ensure call release in finally to avoid resource leak
                   Patch set 2: Remove unnecessary white spaces

Change-Id: I49a7f2fb99dc8b9560e7c17421125356e45a87ac
[ActivityManager]: Fix the activity visibility state not sync between ActivityManager and WindowManager

Symptom:
When press Home key to home screen, user is able to see the activity's window shown on top of wallpaper and below launcher(widgets).

Root Cause:
The ensureActivitiesVisibleLocked() is called pretty often (for example when a new process bound).
If the top activity "B" was finishing, then the previous activity "A" should be visible.
Therefore, the activity "A" window will be set to visible and then launched activity "A", but it does not updates the visible state in ActivityRecord for "A".
There has a timing issue that if a new activity "C" is started, "C" becomes the new top activity and be resumed.
In that case, Activity "A" window will remain visible even if it is behind a full screen activity "C" because the ActivityRecord.visble of "A" is still false, so the window visibility won't be update.
So when user press home key and back to launcher, the surface of activity "A" will be composed on top of wallpaper.

Solution:
Updates ActivityRecord.visible to true for "A". After "C" is started, the "A" will be called WindowManagerService.setAppVisibility() to set invisible, then called onStop() when execute ensureActivitiesVisibleLocked() again.

Change-Id: I536ba04b95d8d274fea6d679a6493e620bc981e2
Fixed cancel() not working correctly

The method handleMessage(Message msg) from mHandler variable was
not checking if the timer was cancelled, so
sendMessageDelayed(obtainMessage(MSG), delay) was keeping the
timer alive. The patch simply adds a boolean and checks if the
CountDownTimer was cancelled before calling
sendMessageDelayed(obtainMessage(MSG), delay)

bug: https://code.google.com/p/android/issues/detail?id=58668

Change-Id: Ic6bbb9d33a3616f8503db222513cc14ad2270cb8
Signed-off-by: jl1990 <jlcarrasco1990@gmail.com>
Missing break in switch statement

Change-Id: I462c0c5fec96a850032266b04419ec409ad02174
fw: Ribbons Icon Gravity

Change-Id: I2ab6bd7231aae38a847c809e74f1374c9ddcb8ce
Signed-off-by: Steve Spear <steve.spear@openpeak.com>
Statusbar: Allow network stats to participate in lights out mode

Change-Id: I424f9382ed502b15ab243a9ba5a80c37285bce38
Signed-off-by: Brandon McAnsh <brandon.mcansh@gmail.com>
FW: remove hardware rebinding reboot requirement

*updateSettings() is called onChange, so update the
 key assignments when updateSettings is called.

Change-Id: I0cf5ff6dfc7abee782aa56c8c95f8a9f19f99494
Signed-off-by: Jonathan Steadman <xxwhitehawk@gmail.com>
SystemUI: fix usb tether toggle not updating its state

added missing permission android.permission.CONNECTIVITY_INTERNAL

Change-Id: Ic0b2dad01c5b5d53a17b7996e3c3324538a5a411
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
Toggles: fix logic to check if usb tether is active

Change-Id: I703f2f14e3587620c44df5bf0f7030a9fe3c0041
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
Keyguard: bring back longpress unlock

This will readd the possibility to unlock the device by
longpressing the lock icon when widgets are maximized.

Change-Id: I8dba1ed49a4731ba388ab9ee050cf56925d678a0
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
FW: Enable nav bar for devices with hardware keys

Change-Id: I2704e99571deff62523da8113971096f79d14fc9
Signed-off-by: Brandon McAnsh <brandon.mcansh@gmail.com>
base: Add battery level around unlock handle [1/2]

PS2:
added missing change in KeyguardSelectorView.java

Change-Id: Ia4dbc2335657c096c34349ec67c4adfec0aeb91b

Conflicts:
	core/java/android/provider/Settings.java
	packages/Keyguard/src/com/android/keyguard/KeyguardSelectorView.java