SystemUI: NavbarEditor: Fix saveKeys logic

In landscape, the keys are saved backwards in the for-loop, but it would crash out due from
an IndexOutOfBounds error since it's subtracting i from the array length while i = 0.

Change-Id: I405c5d962d8c575cfee57b09a7e55a8a6efc2d24
Frameworks: apple can do...we can do as well

incredible apple engineers speeded up the overall UI and reduced per default slightly
the animation scales. Well we do as well and reduce it from 1 to 0.75...smooth, looks well
and does not break anything

Change-Id: Icbcc889e49c8d3ab24cf2b1c10bbe0e8bf7e7637
Switch to Slim Incall UI

Credits to SlimRoms
QuickSettings: Use a Bug Report tile icon of proper size

Reuse of the ADB drawables causes alignment issues here.

Change-Id: I837fa83662bbbd1f4c2e073b72f64a4edae128ff
SystemUI: hide up arrow NavRing indicator if no targets present

If there aren't any navring targets setup (the user has removed all of
them, or maybe search assistant is not present) then there is still a
hint in the lockscreen to pull up from the nav bar.

If there are no targets setup, hide the arrow indicator.

Change-Id: I65103a4cec668a9a8b3f678f991f5acba17d19f5
Signed-off-by: Roman Birg <roman@cyngn.com>

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
frameworks: extend TorchService to be able to handle sysfs torch config

Some devices are still using a sysfs node to control the torch. Let's
support those configurations and properly shut the torch down.

Change-Id: I5fa1cccdcffad26dbfef4b2ee0eafe1218a5308b
Signed-off-by: Roman Birg <roman@cyngn.com>
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
Use hidden API to validate APK chains

Bug: 13678484
Change-Id: I28dedab74b0e24d47ab9f2190298156c909e9d54
(cherry picked from commit 5a30e8a0ebb19852902361079b139ee160a53588)
inputdevices: update from aosp (master)

Change-Id: If5fb11c354ea0144cdae1434de4c536302dda5b3
[HWUI]: fix residual line on FrameBuffer

Symptom: If app applies animation to enlarge a bitmap, there will be an residual
         line on the screen

Root Cause: On platform which has Tile Rendering implementation (ex. Qualcomm
            CPU), startTiling() call will restrict the framebuffer region which
            GPU can affect. So the expansion of clear region by 1 will not take
            effect if startTiling region is not expanded.

Solution: Expand the startTiling region by 1, too.

Reproduce steps: Apply animation to enlarge (and then shrink) a bitmap icon.

Change-Id: I7b4a59e180daa29dbe909d9e11f4093ae1d7396f
[HWUI] Fix invisible views are still shown in popup window

Symptom: Invisible views are still shown in popup window

Root Cause: glClear isn't called if there is no draw command

Solution: Even if there is no draw command, it still calls glClear
          by startFrame().

Reproduce steps: App set one view in a popup window to invisible,
                 it will be still visible.

Change-Id: I36bc7b752434ad388fbb80ea63341ac778f48d35
Revert Update the layer's alpha value upon composition of the layer

...
watermark: Place watermark in the bottom-right when both deltax and deltaty are 0

The default behavior is to replicate the watermark all over the screen but this can
be too intrusive. The repetition is controlled by deltax and deltay and if they are
both 0 the watermark will actually be drawn off-screen and thus not shown.

We take advantage of this to add a special behavior when they are both 0 that simply
places them in the bottom right. This patch doesn't take UI elements into account and
may actually overlay soft-buttons and other chrome.

Change-Id: I4cff1326b8aaecdbc471eaf48e95bc2865181366
Remove opaque check in preparing dirty region

Since preserve swap is enabled, we need to clear the color buffer
when the scissor rect is prepared for a new process. This prevents
garbage being present from the previous process in the color buffer.

CRs-Fixed: 549755

Change-Id: Icd12ae388077b8c9ed329c37314e896500078543
(cherry picked from commit 48b6a9767317e08a24e189c9cbee21043543682a)
(cherry picked from commit 777610a5ddf19cebcad30b7e9a481e9dfe38b74c)
Update the layer's alpha value upon composition of the layer

Fixes: This patch makes sure that the layer's alpha value is
up-to-date and does not reflect the previous view's alpha value.
It fixes the square block on marquee fading edge when text view
is applied transparency.

CRs-Fixed: 562000

Change-Id: I397308b739f5f4fe4b630cf594825f401c97e0e3
hwui: Always enable the scissor while composing layer

Due to scissor optimization feature added in KK, scissor was disabled
all the time. Hence the undefined areas/region of textures are not
masking properly with GL_LINEAR filter mode.

Change-Id: Ifbbde2c67a4c01e45eda07ada709e066255fffcb
CRs-fixed: 645077
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>
core: use 'normal' value for notification led off

Users can set this value to 250, 500, 1000, 2500 or 5000ms only,
but it's 2000ms by default.

With this patch, 'Normal' string is shown instead of 'By default'
and pulse speed goes to 1 sec.

Change-Id: Idb18ac345bd9eb1a5b795776faa60e2fb5bc258b
hwui: Apply hwui qcom fixes to all adreno-bearing hardware

Even if the device doesn't fully use the qcom stack, changes to
libhwui are generally workarounds for adreno-specific issues and
apply across the board without other dependencies

Change-Id: I10455ebf09c1d00762b06e3c092398604bb39796
Finish fixing Zygote descriptor leakage problem

In order to prevent Zygote descriptors from leaking into the child
environment, they should be closed by the forked-off child process
before the child switches to the application UID.  These changes close
the descriptors via dup2(), substituting a descriptor open to
/dev/null in their place; this allows the Zygote Java code to close
the FileDescriptor objects cleanly.

This is a multi-project change: dalvik, art, libcore, frameworks/base,
and external/sepolicy are affected.  The CLs need to be approved
together, lest the build break or the software fail to boot.

Round 2: indent change

Bug: 12114500
Change-Id: I090402136a8a8b7d6aad6eb153026e85d7cf6ad3