build core/jni with fstrict-aliasing

PS2: Make our own SkRect so skia doesn't need to know what an android::Rect is

Credit to David96 for the inspiration for the fix

Signed-off-by: nuclearmistake <nuclearmistake@gmail.com>
Change-Id: I3233728d8a0a44d085f20729b3c24f197d75741e

Conflicts:
	core/jni/Android.mk

Conflicts:
	core/jni/Android.mk
WallpaperCropper: respect max wallpaper width

Some devices with high resolution screen only support 2048px wide
wallpaper (used to be fixed in I5b25bd931db0b2610e260921f28b92d8b0966aa6)

Pre-KitKat this works as follows:

- Launcher calls WallpaperManager.suggestDesiredDimensions and we
  limit the maximum size in that function
- The wallpaper setting application calls WallpaperManager
  .getDesiredMinimumWidth and respects that size

However, after KitKat, it is all broken because WallpaperCropper
now calculate its own dimension and does respect the value set by
getDesiredMinimumWidth (and it calls suggestDesiredDimensions,
which is supposed to be reserved for Launchers!)

Attempting to restore wallpaper setting by:

- Having WallpaperCropper respect config_wallpaperMaxWidth
- Having CMWallpaper (which copy pasted code from WallpaperCropper)
  respect getDesiredMinimumWidth
- For third party applications, if they respect getDesiredMinimumWidth,
  then they will work, but if they don't (i.e. uses WallpaperCropper's
  code), then there's nothing we can do.

Change-Id: Ib7da12a1c70befbeef2f305593d3841acbc45243
AppWidget: Make widget update quickly

Can't display the Power control widget after power on DUT for
3 mins. Because of the  update intent is received after power
on DUT for 3 mins.

Set the intent to foregound

CRs-Fixed: 707605

Change-Id: I5418c84a7dc79466be7a30bb3672ea41976badb0
Squashed FML changes.

Fix aliasing violation.

frameworks/base: Fix build in ISO C++11 mode

Fix various incompatibilities with ISO C++11:
- Assumption that char16_t is defined to uint16_t
- constexpr usage
- macro constructs that could be interpreted as string literals
- enum typesafety

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>

Conflicts:
	core/jni/android_os_FileUtils.cpp

base: Fix build after Parcel ABI fix in Binder

Adapt code to the fact that writeString16's first parameter
is now an uint16_t* to match the old ABI

Change-Id: I138af645c877f343f0490152b9702698b7d36582
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

frameworks/base: Fix compile errors

Fix ISO C++11 incompatibility in TextLayoutCache and
aliasing violation in FontRenderer

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>

frameworks/base: Fix build in ISO C++11 mode

Change-Id: I5d3ba44cc9faa5826a5a0a6b37c8f0eb2872e1ac
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>

hwui: Fix build in ISO C++11 mode

Make sure log calls can't be confused with C++11 string literals

Change-Id: I1d458e92e690f6f2b922a05494db8c01da54e460
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

More C++11 fixings.

More C++11 fixes. More.

Fix confusion about whether or not output() should be const

It probably should be const, but it isn't on master - let's try to
be closer to next upstream

Change-Id: Id26bf19d94a36d83b57488e8bd8d86fa21e784b2
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
Use default visibility for Snapshot::getLocalClip.

The method is in libhwui.so but used by libandroid_runtime.so
(via android_view_GLES20Canvas.cpp). If the compiler decides not to
inline this method, the linker won't be able to resolve the dependency
when it has hidden visibility.

The problem is found when testing GCC 4.9.

Change-Id: I3b4d096c7767f0bef0796886dfb2c5ba2ecff48c
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>

Conflicts:
	libs/hwui/OpenGLRenderer.cpp
QuickSettings: Use plurals for Bluetooth tile

* Some languages need this

Change-Id: I953aee702fcc381dd4bfb3a18fa183341a138ba3
framework: Close system windows when performing 'switch to last app' action

This fixes a bug where performing the action while on the recent apps screen
would cause the next attempt to open recent apps require two presses of the
recent apps button (the first press would toggle it closed, rather than open).

It also prevents the switch from being obscured by the notifications shade.

Change-Id: I2220149ce604a25501121abc29e5d88f8b1cbf4f
core: Add back mistakenly removed string

Change-Id: Ia56f05ebf87f16b9304fe8fa0664874fcc03697c
Automatic translation import

Change-Id: Ie45913a911cf7877a128c3138c347ef31009c91e
Core: Improve AOSP JA translation

They translated "hotspot" as "アクセスポイント"(access point) but it just gets us confused.
"テザリング"(Tethering) is preferred than "アクセスポイント"(access point) in Japanese translation.
FYI, most vendors fixed these strings e.g. Samsung and Sony.

Change-Id: Ic13ec6d33f411b026d90312600d0150bc3a759b0