Revert "Implement DocumentsProvider.createDocument and deleteDocument"

The original commit breaks the public API and causes crashes when
deleting certain items in DocumentsUI

This reverts commit f6bfaee6ad7ccd4491609d5df606558a4ae30f72.

Change-Id: I5a433148548e7a1a997ee50e5938f7a4cb4c5ade
SettingConfirmationHelper: Unbreak public api

Missing @hide for javadoc breaks public api.

Change-Id: I29c5e8b5b2ae5a998fdf84895808f79d1e7ae500
Signed-off-by: Evan Anderson <evan@thelinuxman.us>
Automatic Translation Import

Change-Id: I1a255c84ce5c94069735b48bb4345f0508a45be4
ExpandHelper: Performance improvement during expanding

- Reflects on Hover mainly
- Add an helper to get natural height

Thanks to Kiril Mikos @mik9 http://review.cyanogenmod.org/#/c/66676/

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
HOVER: Respect screen limits when adding view

As for what @Decad3nce reported here http://review.cyanogenmod.org/#/c/66654/
we shouldn't keep FLAG_LAYOUT_NO_LIMITS so view doesn't exceed the screen limits.

Thank you Adnan :)

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Change-Id: Ifcbc4a1143362e1b7dd40e710126060688c894b9
BatteryMeter: Isolate QS resources too, specify label as for status bar

- This way we can theme PA separately, will not reflect with CM
  so we don't end theming both CM statusbar and QS indicators while
  we want to do just QS and testing base is PA.

PS2: Use status bar color in style, is about the status bar icon so no need to keep using qs one.
PS3: Fix new array name

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Change-Id: I104f4b435470745e8b4bcb7fb2413148b24766c9
Themes: add ability to theme quick settings battery tiles

This is to make the battery tiles more uniform to the rest
of quick settings and also allow the background to be themed

http://i.imgur.com/AA5bkMK.png

PA Changes: adapt for PA quick settings thanks to @linuxman94

Change-Id: Iec03572a0fa3619d2652f30b6c260a278ed0c86b
Signed-off-by: Evan Anderson <evan@thelinuxman.us>
Fix thumbnail bug

When there was no thumbnail for a given image, the getThumbNail() convenience
method could return a previously-returned thumbnail instead of null.

b/15771860
https://code.google.com/p/android/issues/detail?id=40714

Change-Id: Ibd18e048145bf347469f800afdf436247ea6b693
Signed-off-by: houst0nn <houstonn@gmail.com>
Fixed VM memory leak in AudioSystem JNI interface

The function android_media_AudioSystem_error_callback from AudioSystem
JNI interface is using FindClass function but does not delete the
reference created by VM in this function.
By doing this call, VM will add a local reference in IndirectRefTable
and it's the caller's job to delete this reference.
By not doing this, everytime this callback is called, a new reference is
added and never deleted.
The effect is crashing the VM running system_server:

E/dalvikvm( 3071): JNI ERROR (app bug): local reference table overflow (max=512)
W/dalvikvm( 3071): JNI local reference table (0x732da288) dump:
W/dalvikvm( 3071):   Last 10 entries (of 512):
W/dalvikvm( 3071):       511: 0x42a90008 java.lang.Class<android.os.Parcel>
W/dalvikvm( 3071):       510: 0x4381fd90 android.view.KeyEvent
W/dalvikvm( 3071):       509: 0x439b9808 android.view.KeyEvent
W/dalvikvm( 3071):       508: 0x42d2fe18 java.lang.Class<com.android.server.input.InputManagerService>
W/dalvikvm( 3071):       507: 0x42ad4298 java.lang.Class<android.media.AudioSystem>
W/dalvikvm( 3071):       506: 0x42ad4298 java.lang.Class<android.media.AudioSystem>
W/dalvikvm( 3071):       505: 0x42ad4298 java.lang.Class<android.media.AudioSystem>
W/dalvikvm( 3071):       504: 0x42ad4298 java.lang.Class<android.media.AudioSystem>
W/dalvikvm( 3071):       503: 0x42ad4298 java.lang.Class<android.media.AudioSystem>
W/dalvikvm( 3071):       502: 0x42ad4298 java.lang.Class<android.media.AudioSystem>
W/dalvikvm( 3071):   Summary:
W/dalvikvm( 3071):       510 of java.lang.Class (3 unique instances)
W/dalvikvm( 3071):         2 of android.view.KeyEvent (2 unique instances)
E/dalvikvm( 3071): Failed adding to JNI local ref table (has 512 entries)
...
E/dalvikvm( 3071): VM aborting

In this case, PID 3071 is system server.

Change-Id: I0c113eb72256984854d59a3ccef11a8d23f96e79
Signed-off-by: Robert Chiras <robert.chiras@intel.com>
Signed-off-by: houst0nn <houstonn@gmail.com>
HOVER: Don't treat touch outside event as true if is animating

- It needs to wait animation to be finished to start listen for touch outside
  and runs hide timer.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
base: LT translations

Fixes/improvements

Change-Id: Ic42ecc0398ba342b410daa324a8d4c4d87065708
MSIM: Add support for cell info

Add suport for getAllCellInfo in MSIM

Change-Id: I9d61723b4c73f595dafd18275532f80a9a6390ff
CRs-Fixed: 654445
IndexOutOfBoundsException observed rarely in ProcessStats

Sometime IndexOutOfBoundsException is observed in ProcessStats
while allocating longs array. This could be due to synchronization.
This fix will return if array index is >= size.

Change-Id: I1df34152c95f2ff61829da07f750e79a6f1efab3
CRs-fixed: 626638
Fix a resource race bug in PathCache

When enabled defer rendering, it will do precache for DrawPathOp.
The paint used for creating PathTask in precache just get the address
of mFilteredPaint of OpenGLRenderer. So for the following defer
operation like DrawTextOp has possibility change the mFilteredPaint
by getPaint while another WorkerThread in PathCache is using the paint
which pointed to the same address of mFilteredPaint to generate bitmap.
As a result, it will generate a wrong bitmap for generateTexture in
PathCache. To fix it, do a copy of paint when creating PathTask.

CRs-Fixed: 664244

Change-Id: I5516f5b143458b88d3573d15b7ebb34f688800c7
base: App crash when select suggestion's length more than specified.

App crashed by catch IndexOutOfBoundsException which raised
by check span range when select suggested string.The root
cause is that the editor will truncate the suggested string
which length is more than it specified, but it also set span
use the suggestion's original length.

Update the suggestion's real length after editor replace the
original string to suggested.

Change-Id: I2d765701934a9e68be172cb87a104590f3cdeceb
CRs-Fixed: 532211
Applications crash observed while selecting words from suggestion list

While selecting words from suggestion list, applications are crashing as
textview span are going out of index. For textinput where spaces are not
allowed length difference shall be calculated properly to avoid Index
out of bound situations.

Change-Id: I360318cf9241abbb7f58ad1ddf3f3c8d364f17d1
CRs-Fixed: 642057
MMS: Fix Messaging will force close after tap one item in suggestion list

The span end is larger than string's length, it caused IndexOutOfBounds
exception.

Check the span end to avoid the IndexOutOfBounds exception.

CRs-Fixed: 555378

Change-Id: Iaf1cbe8db8704b3112afb6207982750b650fe5c5
Fixing IndexOutOfBounds Exception in ActivityManager

Bypass the iteration to avoid the exception during
the execution of ensureActivityVisibleLocked() because
startSpecificActivityLocked() within the loop may delete
the elements from History stack.

Change-Id: I195da10a8e9161572bdb653ad3021998d4f2a939
CRs-Fixed: 651963
base: Add support for FLAG_SUPPORTS_PROTECTED_BUFFERS

For the clients (WFD) which need secure HWC composition,
FLAG_SUPPORTS_PROTECTED_BUFFERS need to be set.
- Define new flag VIRTUAL_DISPLAY_SUPPORTS_PROTECTED_BUFFERS
- In VirtualDisplayAdapter, add support for the flag
FLAG_SUPPORTS_PROTECTED_BUFFERS.

CRs-Fixed: 653794
Change-Id: Ib954943f3e27067b2805188771f951c115833237
Telephony(MSIM): Fix tcp buffersize issue

On a multi-sim device, getNetworkType function call
in getTcpBufferSizesPropName function of
MobileDataStateTracker will return data radio technology
value on the subscription on which data call is
currently active.

Change-Id: I7c36a408cfa090a2801d03f61f86d6d1a148c7c2
CRs-Fixed: 661835