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
Revert "Add support for allow-permission extension."

This is not currently in use and can be replaced by a better solution.

This reverts commit 33110a0b2f4cdfd2ee6911a479d1fbbcd14bc389.

Change-Id: I672381398c8d09275226a0ef4ead408e2ccbd040
Merge remote-tracking branch 'pa/kitkat' into kitkat
ActivityManagerService: Penalise large apps going to background

Large applications (PSS more than a given threshold) when closed are
penalised with higher ADJ. Now, they will be more prone to be killed by
lowmemorykiller during memory pressure levels. This ensures better app
concurrency and improved subsequent latencies as it leaves some more room
for other smaller bg apps to be alive

Change-Id: I448fa12f55370949b22075595cd75b9c29e5d4b5
ActivityManagerService: Fix heavy games kill during incoming call

Force heavy apps penalisation only to large "cached" apps. Donot
include "previous" app in this category. This ensures large apps
are not killed during special incoming alerts like incall, sms.

Change-Id: I51b4a238415efad63ef36f7e0cd056823a72a47d
Prevent killing of process during service bringup

ActivityManagerService sometimes kills the process whose service
is being brought up during bindService.
This happens when the process starts hitting some Pss threashold.
Specifically this is causing InCallUI process to be killed during
bind request from Phone app.

CRs-Fixed: 681329

Change-Id: Id548a22d7e7ce3aa0b0511763078f813fafd6e16
base: Change mobile provision checking to 3 times' HTTP connection

For mobile provisioning checking, somehow server is unreachable.
There is more than 10 TCP packets sending out without any TCP ACK
in 1 minutes. It will trigger data stall detection and finally
will cause radio reset happened after several iterations.

This fix will change mobile provisioning checking to only use HTTP
connection for at most 3 times. It will be finished in shorter time
and less than 10 TCP SYNC packets are sent. Hence even server is
unreachable, it will not trigger data stall detection.

CRs-Fixed: 715233
Change-Id: I01a76214b801415969436fee33fdb2c40dcf5793
[Resources] fix preload drawables low issue

Symptom: preload drawables too few
Root Cause: verifyPreloadConfig() function not correct. We need to
convert the config to native config and mask the 0x40000000 bit.
Solution: correct the verifyPreloadConfig() function.
Project: AOSP
Note:

Change-Id: I63eb2a7bf50c89fcb37e62423aae8f4f7e81c6aa