Improve scrolling cache

    Scrolling cache helps make short scrolls/flings smooth but will
    cause stutter when long flings are made. This patch disables
    scrolling cache when long flings are made.

    This patch also fixes a related bug where scrolling cache will
    not be enabled properly when transitioning from flinging to scrolling.

    Patch Set 2: Calculate threshold based on maximum velocity (Sang Tae Park)

    Credits: Pawit Pornkitprasan

Change-Id: Iad52a35120212c871ffd35df6184aeb678ee44aa
Remove test media

Change-Id: I2944486a6d168c9a6ab685988b261e8511e9d47d
Fix FC on boot until battery stat is present

updateLightsLocked() can be called from CM's added SettingsObserver
when battery stat is not present, causing an FC and a loop until
battery stat is present.

I/SystemServer(  502): Battery Service
E/System  (  502): ******************************************
E/System  (  502): ************ Failure starting core service
E/System  (  502): java.lang.NullPointerException
E/System  (  502): 	at com.android.server.BatteryService$Led.updateLightsLocked(BatteryService.java:735)
E/System  (  502): 	at com.android.server.BatteryService.updateLedPulse(BatteryService.java:709)
E/System  (  502): 	at com.android.server.BatteryService.access$1600(BatteryService.java:86)
E/System  (  502): 	at com.android.server.BatteryService$SettingsObserver.update(BatteryService.java:860)
E/System  (  502): 	at com.android.server.BatteryService$SettingsObserver.observe(BatteryService.java:822)
E/System  (  502): 	at com.android.server.BatteryService.<init>(BatteryService.java:187)
E/System  (  502): 	at com.android.server.ServerThread.initAndLoop(SystemServer.java:328)
E/System  (  502): 	at com.android.server.SystemServer.main(SystemServer.java:1309)
E/System  (  502): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/System  (  502): 	at java.lang.reflect.Method.invoke(Method.java:515)
E/System  (  502): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:781)
E/System  (  502): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/System  (  502): 	at dalvik.system.NativeStart.main(Native Method)

Change-Id: Ic4438fe50e98f1aa05ae1d0d26240bf9410fd92f
Properly handle null URIs.

Change-Id: Ib81044686f40284bacf6ee645c671679f62be843
Fix for screenshot animation glitch in portrait

edits by Stefano Semeraro aka Suxsem.

Change-Id: I7a03a24c5b1bfdfe616f940b2bd7be42091f45a6
Fix image/bitmap retrieval

Change I66005dd69b0a5c8f4353bd7a8225d163a654fd2d changed the insertion
and creation indexing mechanism, but the retrieval method was still
using the old sparse one. Fixit

Fixes android.provider.cts.MediaStore_Images_MediaTest#testInsertImageWithBitmap,
android.provider.cts.MediaStore_Images_MediaTest#testInsertImageWithImagePath,
android.provider.cts.MediaStore_Images_ThumbnailsTest#testQueryExternalMiniThumbnails,
and android.provider.cts.MediaStore_Video_ThumbnailsTest#testGetThumbnail

Change-Id: I41feea79fa304635f3908055fb95a8c85718a97f
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
Make ImageView drawable update more efficient in some cases.

When updating the view's drawable via setImageResource or setImageURI,
make sure to skip the layout pass if the old and new drawable have equal
sizes. This follows what is already done for setDrawable().

Change-Id: If73d225e38d0a2f7c616c4aeb33f67bdaed390f1
extend PreferenceActivity for title text on a single pane mode

startPreferencePanel() ignores titleText on a single pane mode
this commits extends PreferenceActivity by adding EXTRA_SHOW_FRAGMENT_TITLE_TEXT to intent

ported from CM9, http://review.cyanogenmod.org/#/c/14919
AOSP part verified, but not merged

Change-Id: Ie0702dc20b17504148f4da9cc83a6d7865d95423
Fix GSM signal strength

Certain OEM gsm ril libs send back a bogus value for LTE signal
that causes SignalStrength.java to default to LTE and report
incorrect signal values.
Use prop value ro.telephony.ril.v3=signalstrength to get proper
GSM signal reading on certain devices.

Change-Id: I86279dcbc350fe718d89070acc12178de3c600c2
Fix external sdcard mountpoint

It needs to add that line on init.xxxx.rc on rootdir folders.

"chown root root /mnt/media_rw"

Needed for devices that has some troubles mounting storages.

Credits: http://forum.xda-developers.com/showthread.php?t=2537793

Change-Id: I0c9e2ae5439c8d8a762904e2760eb6590ce77a62
Make "SD Card removed" notification dismissible if the removed SD Card is not the primary storage

The Galaxy S uses the "external SD Card" as the extended storage
and it the notification should be dismissible as it's okay not
to have it.

Additionally, this patch also not hide the USB storage mount dialog
if the removed storage is not the primary storage

Change-Id: Ic752a3da917e0d7736a619fb68f07905106987fb
SystemUI: Add missing recycle calls

Change-Id: I6e5346d9f423350e643d696299136799b78cdd28
Merge changes I6e5346d9,Ic752a3da,I0c9e2ae5,I86279dcb,Ie0702dc2,If73d225e,I66005dd6,I41feea79,I7a03a24c,Ib8104468,Ic4438fe5,I2944486a,Iad52a351 into lollipop

* changes:
  SystemUI: Add missing recycle calls
  Make "SD Card removed" notification dismissible if the removed SD Card is not the primary storage
  Fix external sdcard mountpoint
  Fix GSM signal strength
  extend PreferenceActivity for title text on a single pane mode
  Make ImageView drawable update more efficient in some cases.
  Rework thumbnail handling
  Fix image/bitmap retrieval
  Fix for screenshot animation glitch in portrait
  Properly handle null URIs.
  Fix FC on boot until battery stat is present
  Remove test media
      Improve scrolling cache