HeadsUp: Only remove heads up if attached to window

Attempting to remove mHeadsUpNoficiationView from the window manager
when it is not currently attached will throw an IllegalArgumentException
so we check if it is attached and if so remove it, otherwise carry on.

As well remove possible left children in statusbarview

Change-Id: Ida916eba496c4183e47288ef24a8a93c46a7eddf
SystemUI: improve one finger notification expansion

Sometimes the quick settings ribbon would eat the initial ACTION_DOWN
setting mInitialTouchY in the expand helper, but we are clearly not in a
notification that we can expand here. So only set the initial y point if
we are inside the notification scrollview.

Change-Id: I628553ac15cc6b4ee3c682fe46bd1d96c6bc154d
PackageManager: Fix logic around upgrading text display

* This code has all threads writing into the integer keeping track of
  the number of packages at once.
* Make this integer an atomic one, preventing all threads from racing
  when updating it.

Change-Id: I727306f8ab20edb7ec2a955ca20e6de0146c7737
MountService: Check for null pointer when looking for vold code

* There is actually no code path that will set an event into
  NativeDaemonConnectorException, so any reference to the event code
  will result in a null pointer exception, taking down MountService and
  the rest of the system with it.

Change-Id: Id62f724953aacc363b3455584c6a3ad1381c6138
inputdevices: update from aosp (master)

Change-Id: If5fb11c354ea0144cdae1434de4c536302dda5b3