Solve a possible NPE in the Documents provider

This commit follows an internal bug report to fix a NPE that would be
thrown in specific situations on specific devices. All callers should
be able to handle the returned null value but if they don't, we can
worry about that later down the line. This null value should not be
returned under normal circumstances anyway.

Change-Id: I274844bf07733643923d5729259f1d9d9cf75e54
libhwui: Fix a native crash with patch caching

This commit makes the system silently deal with requests to remove
patches that have already been tagged for removal instead of dumping.
The garbage collector method (PatchCache::clearGarbage) should deal
with getting rid of this patch at a later date regardless since it
has already been added to the garbage array.

Fixes AOSPA-835.

Change-Id: I9bd801926bc5de5cdb0324c9ddeb91bd8bbfe155
systemui: networkcontroller update default networks resources

Default network resources are locale dependent and should be update to reflect the
current user locale, if the locale changed.

Change-Id: I4688cc7132e0c0707ee30dd67ce025099655cded
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Themes: Only kill launchers if overlays or icons changed

There is no need to kill the launcher for every coponent changed.
The only ones that really concern us in regards to killing launchers
are MODIFIES_OVERLAYS and MODIFIES_ICONS

Change-Id: I840b8e2ecd4b52a33f352809c5d3d2c7e92ce85e
Restore untrusted glStencilMask value on resume after functor

Fixes an issue where the stencil buffer is corrupted
(used in overdraw debugging, path clipping) when used in
conjunction with a HW accelerated WebView.

bug:15023700
bug:16465551

Change-Id: If201b503931380f7107a34e9a9a2f877a50f72b1
Optimize drawBitmapMesh using TRIANGLE_STRIP

Draw BitmapMesh using STRIP instead of TRIANGLES.
Depending on where the bottleneck is located in the pipeline,
there is a potential for saving two-thirds of the time spent rendering.
The speedup is due to avoiding redundant operations,
i.e., mapping each vertex four times to texture and color attribute,
sending each vertex twice to the GPU, vertex processing of GPU ...

In this patch:
1. Refactoring mesh using Strip.
2. Batch triangles by adding degenerate triangles.
3. Optimize computing positions of texture and color attribute.

Benchmark: Drawing Bitmap(1152x768 px) with 200x200 meshes
Performance is doubled (from 26.4 fps to 53 fps, Nexus10).
Memory footprint: only 17% of original method.
(from 240000 to 40401 vertices with xy, uv, rgba data.)

Change-Id: I08c5c20d981d88528ce7b02012feefae468d6ec4
Signed-off-by: kui.zheng <kui.zheng@arm.com>
Missing break in switch statement

Change-Id: I462c0c5fec96a850032266b04419ec409ad02174
Keyguard: update correctly track title and info if screen turns on

AOSP issue - Force update both if screen turns on.

Change-Id: I3d3198534c3ccdaa0ad2f40a967cc092a7dc0a0c
Fix problem where PhoneWindowManager waits for keyguard to draw

This fixes a problem where PhoneWindowManager times out waiting
for keyguard to draw when it's disabled.  Instead, we pass a null
token back which allows PhoneWindowManager to continue.

Fixes bug 11190932

Change-Id: I041ea1d88dca681476d9477a3aab54559976b312
Keyguard: We need to ensure that keyguard is showing as well to set the token

Google fix

https://github.com/SlimRoms/frameworks_base/commit/021806ec33f5f59567f3bb3af135b2a1d88c0951

fixes what it is meant to fix.

But still we need to ensure if the keyguard eg is disabled by 3rd party
apps or the keyguard is not showing due of other reasons to inform PhoneWindowManager over the token
not to wait to draw for the Keyguard and go ahead.

Fix:
Just check for isShowing in addition to the check if KeyGuard is disabled

Change-Id: I5f017a6ccebf12dc717fb6d44802a1c1fee15abc
NFC: getNdefMessage() should throw exception if no tag in field.

According to documentation, an TagLostException should be thrown, if
the tag has been moved out of field when reading NDEF message.

Change-Id: Ib7e485ed442027fdebd5bc7a46101fbca0c88bdb
Prevent a duplicated registration of Observers

If same Observer and same URI are registered, the callback functions are called multiple times
when data identified by a given content URI changes.
It makes system slow and it cause ANR sometimes.
And When run unregisterContentObserver(), just one deleted
but others are remained in mObservers.
So add prevent code to avoid to duplicated registraion of Observers

Change-Id: I5c7845deb682db289ff0d53150ef012174859767
Signed-off-by: muzbit.kim <muzbit.kim@lge.com>
Make incoming call screen style configurable (1/3)

[(3/3) is located in services/telephony ccmc squash commit]

Change-Id: I2183b2db5f4e6603f57df70520a9b7da50a651b8
Merge "NFC: getNdefMessage() should throw exception if no tag in field." into kitkat
Merge "Themes: Only kill launchers if overlays or icons changed" into kitkat
Merge "Prevent a duplicated registration of Observers" into kitkat
Merge "systemui: networkcontroller update default networks resources" into kitkat
Merge "Fix problem where PhoneWindowManager waits for keyguard to draw" into kitkat
Merge "Keyguard: We need to ensure that keyguard is showing as well to set the token" into kitkat
Merge "Restore untrusted glStencilMask value on resume after functor" into kitkat