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 external 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 keep 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.

http://jira.omnirom.org/browse/OMNI-924

Change-Id: Ifdf0cc77c9317935a520c67b598cae532eafba47
Conflicts:
	media/java/android/media/MiniThumbFile.java
[1/2] base: quiet hours bypass contacts

Support a list of comtacts that will always
bypass call and/or text message quiet hours

Change-Id: I51cfc4e5af552a0392581095a37048080a1b7383
Conflicts:
	core/java/android/provider/Settings.java
Merge changes I51cfc4e5,Ifdf0cc77 into kitkat

* changes:
  [1/2] base: quiet hours bypass contacts
  Rework thumbnail handling