Fix keyboard layout notification missing issue

The device changed event was sent before input manager service
gets ready during boot-up, input manager handler has no chance
to deliver notification due to mNotificationManager=null

Change-Id: I5096b86b7b5879cd346b22411064f15d62bf73bb
Add null pointer check for ExifParser

Change-Id: I9a7eee8ebb571a186a57e5094e376e7a7d8ab4b8
ImagerReader: Return the buffer to queue if it fails to lock

Return the buffer to the queue when failing to lock it with the
error ACQUIRE_NO_BUFFERS, which acquireNextImage of
ImageReader will return null. Otherwise, there is no chance to return
the buffer back later since the caller can't get the new SurfaceImage
object.

Change-Id: I774e91d52f3e10c8d2dd88d835505da79086c5b2
TouchExplorer: print error message instead of cause fatal exception

In stead of throwing exception to cause system server dead, printing
out error message will be more reasonable.

Change-Id: I6e9cfdbfaaed6c03972c223c46ed78bfb0e00069
frameworks/base: Fix aliasing violations

Fix violations of strict aliasing rules

Change-Id: I77102a842719ed87a98f2f359549f70a9232987c
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Work around uint16_t vs. char16_t confusion

Change-Id: I188e5a82b2dba821710eaea85d6cbef2ae004ce9
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
Fix Aapt so that duplicate package ID errors are not incorrectly reported.

Aapt falsely reports package ID conflicts unless base packages are included
in strictly ascending order based on their package IDs. This fix addresses
that issue while still detecting and reporting conflicts correctly when they
actually exist.

Change-Id: Ic8059b87f919641d086df88d1556f5fa0063739f
Change 640 integer to DisplayMetrics.DENSITY_XXXHIGH in
getLauncherLargeIconDensity method.

Now DENSITY_XXXHIGH constant value is in DisplayMetrics.
DisplayMetrics.DENSITY_XXXHIGH is more clear than
DisplayMetrics.DENSITY_XHIGH x 2

Change-Id: Iebdc7634171d4caca7f57ed101205e80525e26ea
Avoid SystemUI crash due to NPE

BaseStatusBar.createNotificationViews() returns null
when it reports handleNotificationError(), leading to
a forced crash of the misbehaving app. However, it
should not add a null object of Notification.Entry
since it will also crash SystemUI (crashing at compare).

Change-Id: I86678c8024e931420b0fbab1f36b330e7e75d581
Signed-off-by: houst0nn <houstonn@gmail.com>
Fix halo button
PEEK [1/2]
Sensors are fully disabled when screen is on. When you turn the screen off,
it will start polling both gyroscope and proximity sensor values. If it detects
using the gyroscope sensor that device is lying on a table, it disables proximity
polling. If it detects with proximity sensor that it is in your pocket, it disables
gyroscope polling. This way, we save some battery from the beginning. Later, when you
receive a notification, it enables a partial wakelock (CPU on but at low frequency),
and starts listening for movement, either from getting it out your pocket or lifting
off from the table. If it detects those events, it will turn on screen and show the notification.
Wakelock timeouts on 10 secs, so if you receive a notification and there is no movement in that time,
sensors will stop polling after that time, disabling peek interaction until a new notification comes.
Peek doesn't process low and min priority notifications.

https://plus.google.com/+ParanoidAndroidCorner/posts/3wppxakBSVR

Contributors:
@D4rKn3sSyS
@Anu6is
@BigBrother1984

Change-Id: I995d17fde5a256f23fe37f35e43a0ee7e52663fb
Signed-off-by: Jesus David <jesdga95@gmail.com>
Signed-off-by: Curtis Mayers <curtis.mayers@gmail.com>
Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Change-Id: Ida92cb99dc703547c355fe520a25c53438ced1f4

Conflicts:
	packages/SystemUI/res/values/crom_dimens.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java