Framewors: fix finally recents rambar like it was on 4.2.2

way better now

Change-Id: I6d5ce035a981e3c7db46a5297f43725916170302
Convert to switches [2/2]

Change-Id: I013d631783718cada7591a3b14a4d2aecfb740a0
Advanced low battery indicator options (1/2)

Based on a idea I saw on RootBox and from CR3C0 (thanks guys) which we
modified to an extended version

This commit introduces following new modes to indicate low battery

     * 0 = show dialog + play sound (default)
     * 1 = fire notification + play sound
     * 2 = show dialog only
     * 3 = fire notification only
     * 4 = play sound only
     * 5 = none

Notification behaviour is the same as Pop-up. User can dismiss it manually or it is
dismissed automatically if charger is connected, click on notification opens
PowerUsageSummary. Also you get a status bar ticker message about the notification
and notification is always on first place of list. And last if vibration is enabled
notification vibrates.

Patchsets:
 - codestyle corrections

Patchst
 - add PowerUsageSummary intent

cheers

Change-Id: I84476626b0ff5424454a1132ea4ef77a696070c1
Set Window Animation Transition to 0,5 as default value

Change-Id: I57d8aca11aee32d39e529e87731c28d4145214a8
DockAudio: Route audio via dock for Samsung devices

This patch simply removes the audio routing checks for Samsung
devices and routes audio via the dock when the mobile is docked.

There is no option to disable audio routing out through the dock

Change-Id: Ie3f99101b051326913d06f1c78894d50035f6e62
Notification long press fix

Change-Id: I3568f249409ac0a0b7f38c4242a7271bc6e79fe1
Move 'start music player on headset connection' option out of DSPManager
(1/2)

This option isn't related to DSP manager at all, so it shouldn't be
implemented there.

Change-Id: Ibe35c9739ccb4f4587ee71f514d16fb317bf4034
Revert "platform: Remove mapping of android.permission.CAMERA to camera group"

This reverts commit de1e404d570dd03529c1e4e8ffbbce432e8be4a2.

Change-Id: Ibc62cb0fc9992e6676ed2af9f1718d28257f65d0
PreferenceDrawerActivity: Customize back button behavior

Patch Set 1:
* This will open the drawer on the first back press.
* Terminate the app on second back press
* Added an handler to reset the variable after 5 secs

Patch Set 2:
* Make it acting like Google Hangouts:
If the drawer is open -> Finish
If the drawer is closed -> Open it

Patch Set 3 and 4:

* Removed the Handler and the double back as it's no more needed, this is the perfect behavior!
* Little derp

Change-Id: I5ce4430b3e3c6dcd03198634b62b4dc18dca604b
Signed-off-by: iGio90 <giovanni.rocca.90@gmail.com>
FW: Port HALO Mods (1/2)

* Untested at the moment if someone can provide me some feedback! Thanks

PS3: This also fix the issue encouterd by Bjork

PS2-4: blank. My error

PS5: Remove the Expanded Desktop dependencie for the awesome LongPress action

PS6: Remove whitespaces and tabs

PS7: As asked, restored original LongPress behavior

PS8: HALO tweaks:

-Draw status bubbles only when required (performance)
-Ninja level +1 (disappear if empty, only persistent or pinned apps are present)

Signed-off-by: iGio90 <giovanni.rocca.90@gmail.com>

Change-Id: I3591f60e3436c2ac205449d13044bf8c1b65f7a3
Hide GlowPadView warnings

Make message verbose and contingent on DEBUG. This has been spamming
my logs everytime I touch navbar or lockscreen targets.

Change-Id: Iea1a6db86055d4034405f0ee4e20282b6c493210
NPE in SearchManager.triggerSearch

mAssociatedPackage field is never initialized and cause NPE.

Change-Id: Ibf0d44b2170b7cbfe4a883008254a086e03579c5
set carrier label to gone instead of invisible

Change-Id: Ie1205802147b451aaff8d4a4def29d5c11aa2347
frameworks: squash of leak & race fixes

commit 5c837244a550308a6b8fadf95275d50f6bf3b202
Author: Daniel 2 Olofsson <daniel2.olofsson@sonymobile.com>
Date:   Mon Jun 10 14:49:14 2013 +0200

    Fixed race condition in Spinner.DialogPopup on null reference.

    NullPointerException is triggered when DialogPopup is
    dismissed due to object mPopup being null when not showing.
    Race condition is triggered when dialog is dismissed before
    touch event to dismiss dialog has been processed properly.

    Fixed by adding a null check prior to accessing mPopup object.

    Change-Id: I3c4fe9c279d92a7103fb4f68189d1d42beedc606

commit 4950d85c29bed35c0874858d094d5a0f628f1e54
Author: Pawel Augustyn <pawel.augustyn@sonymobile.com>
Date:   Mon Jul 16 11:23:54 2012 +0200

    Fix for native leaks in YuvToJpegEncoder.cpp

    Objects allocated by Get<object>ArrayElements function,
    should be released. Add a fix to release this objects
    in error cases.

    Change-Id: Idf834523d93bb2dfd6b872e3b2179b7f1bba38f3

commit 463ac945502552ab0c06ae00c987d3c400161fe3
Author: Michal Szynkaruk <michal.szynkaruk@sonymobile.com>
Date:   Wed Jun 26 11:28:36 2013 +0200

    Fix for MemoryLeak in InputMethodService

    Problem: when onConfigrationChanged is called many times,
    mInsetsComputer is added many times to the list.
    Solution: check before if specific listener is already
    in the arraylist.

    Change-Id: Ic730395120d6dc8585628c142b2e161c42317f30

commit 5167ab57b2a1dbee38a5303e4b490a04b9dff950
Author: Pavan Kumar S <pavan.kumar.s@intel.com>
Date:   Fri Aug 3 12:03:01 2012 +0530

    [BatteryStatsImpl] Avoid memory corruption due to Parcel Recycling

    While processing batterystatsfile, in present code there is a race where a parcel
    might be recycled while it is being written to disk in another thread.

    The write process is done in 2 steps:
    - write into a Parcel (memory block)
    - then write this Parcel to disk using Journaled API.
    The Journaled API ensures robustness against file-system issues due to power cut.
    The writing is done in batch using a thread running commitPendingDataToDisk().
    This function writes the parcel to disk but this parcel is a global variable
    initialized by writeLocked(). If the writing takes too long time and two write
    threads are launched, the parcel is freed by the second writeLocked() call;
    which could cause the memory corruption.

    Hence, change global Parcel variable by a Parcel parameter to commitPendingDataToDisk()
    and only this function will be allowed to recycle the parcel.

    Change-Id: Ie86ee0a66434b7107264c79f68411196c7505a34
    Signed-off-by: Pavan Kumar S <pavan.kumar.s@intel.com>
    Author: Pavan Kumar S <pavan.kumar.s@intel.com>
    Signed-off-by: Shuo Gao <shuo.gao@intel.com>
    Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
    Signed-off-by: Jack Ren <jack.ren@intel.com>
    Author-tracking-BZ: 47466 19426

commit ab625310c19573caf5cdcf4c6ef573bbfbc8a26b
Author: Vairavan Srinivasan <vairav@codeaurora.org>
Date:   Mon Jun 6 13:42:54 2011 -0700

    frameworks/base: Fix for the race in Wallpaperservice

    Wallpaperservice has a race among message handler of
    DO_DETACH and service's onDestroy. In certain cases,
    the engine kept track in mActiveEngines is removed by
    message handler of DO_DETACH and service's onDestroy
    doesn't get a entry in mActivieEngines and isn't able
    to invoke detach. This keeps the broadcast receiver,
    mReceiver active and is unregistered by the framework
    and a corresponding leak is reported.

      Later, the message handler of DO_DETACH continues
    and invokes detach on mEngine, which attempts to
    unregister mReceiver and framework throws an exception
    "Receiver not registered: android.service.wallpaper.
    WallpaperService$Engine$1@40874580" and causes the
    framework to reboot.

      In case of system_server, WindownManagerPolicy and
    android.server.ServerThread contest for access of
    shared members, mActiveEngines and mEgine. Fix is to
    protect the critical section via synchronized block.

    Change-Id: Ice79cb8344fb54bcc6e9f76f4b143daac2608d7b

    Conflicts:
    	core/java/android/service/wallpaper/WallpaperService.java

Change-Id: Ib24d04673c5fff21533f7f00456df658cdbc6288
FW: Halo: Remove expanded desktop dependency to longpress action

* Always on is much better!

depends on: http://review.pac-rom.com/#/c/2456/

Signed-off-by: iGio90 <giovanni.rocca.90@gmail.com>
Change-Id: I777d65cc38b3d84212f04ce6405ceb5de8384903
Rework thumbnail handling

Since ids of media file are usually not continuous, the original file of thumbnail are
sparse. When there are big numbers files on ex\
ternal storage, the size of this file will be horrible.
Ex, when the id is 20000, then the .thumbnails/.thumbdata3-xx file will be 50000*10k = 488.28M.
Can refer http://stackoverflow.com/questions/12396715/android-huge-thumbdata4-file-in-dcim-folder
Because after 4.0, MediaProvider will scan any files, this will be a big problem. So I modify MiniThumbFile.java to avoid this.
According to the id, we now produce an index file. In this index file, one id will use BYTES_PER_MINTHUMB_INDEX(8) bytes in offset (i\
d+1)*BYTES_PER_MINTHUMB_INDEX. The data of these 8 bytes is the index of thumbnail file. The first BYTES_PER_MINTHUMB_INDEX bytes kee\
p next available index. And when you need insert a thumbnail, the index increase by 1. In this way, the block data in thumbnail file \
will be continuous. And thus unnecessary zero paddings will not be saved.

Change-Id: I66005dd69b0a5c8f4353bd7a8225d163a654fd2d
SystemUI: do not collapse panels if keyevent was canceled.

Change-Id: I9af82e9fa2305142521075938dfd05521adeb9f4
Fix up 'launch player on headset connection' option.

- don't crash system_server if no music player can be found
- use the active user's setting instead of the owner's setting

Change-Id: I38a07fe5c8c3d67ececd0768e1fcc01a6cf7fa5a
Fix Quick Settings tiles jerking down while animating to notifications view

Change-Id: Ic601d8808855dee667aea3bf368256fbadf9385d
Fix status bar brightness control when on secure lock screen

When the notifications panel is disabled no views are handling touch events
on the status bar, so we see nothing beyond each ACTION_DOWN. Intercept touch
events when needed specifically for brightness control.
Also recycle VelocityTracker when we're not using it, as per its documentation.

Change-Id: Ib96eb6a6fd16d086d318136155e16da10600c8fa