Fix to NullPointerException when activity is relaunched

When ChooseTypeAndAccountActivity is relaunched and resumed
by ActivityManager a call is made to onActivityResult without
first triggering onResume. This leads to mAccounts object
still being null.

Fixed by properly setting mAccounts object if it is null prior
to use after function onCreate has been called.

Change-Id: Ife7e1e052c473970d923fa43ee6189eb62a1113b
core: bring original volume panel expand icon back

This one makes more sense from a UX standpoint
Update the color of the expandable volume panel icon

This still retains the old settings icon since it
happens to fit perfectly. Pressing it does indeed
show you a bunch of sliders like the icon indicates.

Also add xhdpi and xxhdpi versions.
Fix indirect misuse of $(my-dir).

Change-Id: I20a98a8e1378da3a53e6a6d599c8fc0100f7f87a
Signed-off-by: houst0nn <houstonn@gmail.com>
Android Framework Base: DE translation

PS1: translate into German
PS2: fix w -> wischen
PS3: fix Smartphone -> Telefon (like in AOSP)

Change-Id: I102c378c68a9ec06813adac7fc16e4f12b9a52e4
Signed-off-by: Matthias Freund <matthias88freund@gmail.com>
Catalan translation correction

The word "despleguàs" does not exist in Catalan.

Change-Id: Ic789662d63a3c5c59e519b5c6711d4381d94ddc2
Fix for positioning of glyphs within a bitmap

For positioning of glyphs within a bitmap, roundf(int + float) is used,
where the float is the glyph position and the int is the text position.
When the text position is varied, this may lead to the sum being rounded
in different directions, due to floating point rounding, caused by that
floating point numbers have different precision in different ranges.

This may therefore lead to slightly different positioning for glyphs and
therefore slightly different widths and heights for text strings,
depending on the position they are rendered at.

The solution in this patch is to use int + (int) roundf(float), which
has consistent rounding, and also enables us to use the full range of
ints.

Change-Id: Id1143cdfcbdfa9915ced878ae04df589a3e03cee
Release locked buffer when it fails to acquire graphics buffer

The JNI buffer in ImageReader_imageSetup is not released when
it fails to acquire graphics buffer. After all JNI buffers are
exhausted, ACQUIRE_MAX_IMAGES will be returned and leads to
error. The JNI buffer should be released when it fails to acquire
graphics buffer.

Change-Id: I3319a58ac44e36c8593b404672a685c4b589a735
Fixed upgrading from forward-lock application to system application

Fixes the case when the app on system is newer than the
currently installed. Something that can happen e.g. after
a FOTA update.

Change-Id: I102e9cdd5693d5e66667c0c8989dc2643c72dd16
Fix graphics corruption caused by HWUI caches

Some caches(PatchCache, TextureCache, PathCache) for HWUI
uses deferred removal for their cache entries even though
actual resource objects are immediately freed by
ResourceCache.
For this reason, the uniqueness of a resource address in
the caches is not guaranteed in specific cases.
(Because malloc() can return the same address when malloc()
and free() called very frequently.)

So it can be possible the cache have two cache entries for
two different resources but the same memory address.
(Of course one of the resources is already freed.)
It also can be possible mGarbage vector in PatchCache has
duplicated addresses and this can lead to duplicated free
blocks in the free block list and graphics corruption.
(Deferred removal was implmeneted based on an assumption of
unique resource addresses.)

So this patch makes sure resource objects are freed after
the resources are removed from the caches to guarantee
the uniqueness of a resource address and prevent graphics
corruption.

Change-Id: I040f033a4fc783d2c4bc04b113589657c36fb15b
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>

Fix AOSP build - DO NOT MERGE

Change-Id: I42b420c2ce89ce364a2809b28b827964e6923fa1
Quicksettings: New transition animation.

Also new moron effect :D

Signed-off-by: Jesus David <jesdga95@gmail.com>
Change-Id: I7838bced9568c30237a2839e4ef68b24f884d8a5
Quicksettings: Update immersive IT translations.

* Fix offset.
  Addressing JIRA AOSPA-40 issue.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Fix: Linked volumes

Check for linked volumes a little earlier than we previously did.
This ensures the correct value is set after boot.

Change-Id: I207680bed1b849351d6cbb283ae415621fab58b4
Service: Keep services needing restart.

Services needing restart after crash include:
1) service with 'persistent == true'
2) service explicitly reuqired restart by returning START_STICKY
   or START_REDELIVER_INTENT from onStartCommand

Change-Id: Idc490a1ceb1e151a3eb7f34b7b4cf8058a06f34a
Signed-off-by: Liangcai Li <liangcail@nvidia.com>

Conflicts:
	services/java/com/android/server/am/ActiveServices.java
Merge "core: bring original volume panel expand icon back" into kitkat
Merge "Update the color of the expandable volume panel icon" into kitkat
Merge "Fix: Linked volumes" into kitkat
Quicksettings: Better switch effect.

* Take switch outside tile animation.
* Change a bit new X axis animation.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Signed-off-by: Jesus David <jesdga95@gmail.com>
Change-Id: Iad3ff92dddea4bf86650c7269a859ac577063432
Merge branch 'pa_upstream/kitkat'
lights: Add music light support (2/2)

Change-Id: I734e0d09bf9b01c149d456035eaa8ea5db009dad