Tell installd when boot completes.

installd can then clear the ".booting" marker from the dalvik-cache
(owned by root). This marker is used to detect boot loops.

bug: 18280671

(cherry picked from commit 76a748e62f354c799342044f724e1f4b80121837)

Change-Id: I2364c05837ac04d428b5a34ab1802964a11d2df4
Allow ringer mode change to leave priority notification mode

AudioManager.RINGER_MODE_SILENT was re-mapped from to
Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS, but this change:

Change: 806dbae9e12f3875cf0def3da2f3c3c2b768a844
Link: https://github.com/android/platform_frameworks_base/commit/806dbae9e12f3875cf0def3da2f3c3c2b768a844

This made it impossible to turn off zen mode by setting the
ringer mode to either AudioManager.RINGER_MODE_VIBRATE or
AudioManager.RINGER_MODE_NORMAL, as described in documentation:

https://developer.android.com/about/versions/android-5.0-changes.html

Issue: https://code.google.com/p/android-developer-preview/issues/detail?id=1780

This change restores that functionality.

PatchSet 2:
Simplify this to only check if zen mode is not already off

Signed-off-by: Bryan Emmanuel <piusvelte@gmail.com>
Fix memory leak where we close the descriptor instead of the file.

(cherry pick of 5cb769d99952ef9fb4f576abba70423fe157342b.)

bug: 17541634
Change-Id: I9968f9df249e4cba24383239ce6130dd16fcd532
Start MountService before performBootDexOpt

This change is to start Mountservice before starting
performBootDexOpt, as in one case, in performBootDexOpt
when system upgrade happens, StorageManager will be started to
get the low threshold of DataDir. But, at this point, as
Mountservice is still not up, StorageManager will end up
having a null object of Mountservice.

Change-Id: I6dec474266faa5de67449c1bbe6ef30791e5ecaa
Sync focus stack frame and layer with focus app.

Update focus stack frame/layer when focus app is changed to avoid
focus stack/layer isn't updated synchronously with focus app, it's
due to performLayoutAndPlaceSurfacesLocked() is not necessarily
called on focus app change; it will cause sending mismatching
TAP_OUTSIDE_STACK message if there is effectual incoming pointer
event, hence may also result in focus stack is changed again,
therefore erroneous focus app is set by ActivityManager at final.

Change-Id: Ia0ec9a543be887b51a3b29b3e62fdd471c15edf2
Signed-off-by: tingna_sung <tingna_sung@htc.com>
Not include fullscreen opaque window on screenshot

Extend the fullscreen meaning by adding opaque drawn check on
screenshot application; if there is a fullscreen window but not
opaque, we will continue finding behind windows; otherwise ending up
including behind windows. It's able to help avoiding capturing BLACK
screenshot bitmap.

Change-Id: I1c7e8f513c366688ea8001c3d0c799f3522f0ffd
Signed-off-by: tingna_sung <tingna_sung@htc.com>
Measure absolute value of pointer motion distance

If pointer is moving to the negative axis direction, pointer movement
distance will always less than pre-defined mMotionSlop, thus
TAP_OUTSIDE_STACK will have chance to be sent, will cause unnecessary
focus stack switch.

Change-Id: Ia4c066bebce250257c7361ef976907a0ca2c6461
Signed-off-by: tingna_sung <tingna_sung@htc.com>
ANR caused by incorrect cleanup in BroadcastQueue.

Two broadcasts could be sent to the same app simultaneously:
one foreground, one background. For example, LOCALE_CHANGED
and PACKAGE_CHANGED are delievered to com.android.vending
at the same time.
1. AMS started new vending process to handle LOCALE_CHANGED.
   And set app.curReceiver = LOCALE_CHANGED.
2. Before LOCALE_CHANGED is handled by vending process,
   PACKAGE_CHANGED was delievered to vending process too.
   AMS set app.curReceiver = PACKAGE_CHANGED. Bad!
3. Vending process finished handling LOCALE_CHANGED.
   AMS clear app.curReceiver = NULL. Bad!
   And Vending process  killed itself without handling
   PACKAGE_CHANGED.
4. AMS known vending process has died, but didn't know that
   BgBroadcastQueue was still waiting for finish message
   for PACKAGE_CHANGED.
At last, BgBroadcastQueue reported ANR for PACKAGE_CHANGED.

This patch adds protection before clearing app.curReceiver,
only set to NULL if the finishing receiver = app.curReceiver
So handleAppDied would know that PACKAGE_CHANGED was not
finished yet, it will abort the broadcast and continue.

Change-Id: Ic4f31b35e21823d4a3c27712391ecbede213a494
Signed-off-by: Guobin Zhang <guobin.zhang@intel.com>
Fix bad exclude region in landscape

Update DisplayContent.mBaseDisplayRect when device orientation is
changed, it avoids to set incorrect initial value of
mTouchExcludeRegion, that will cause result of calculated
mTouchExcludeRegion becomes an incorrect strange region on
landscape orientation.

Change-Id: I993864653edc2852f91abed7891e6631b4bae15a
Signed-off-by: tingna_sung <tingna_sung@htc.com>
Add clear all recents action to recents panel

Change-Id: I2243ebc83abc483e78b112900a653d7e61edc5ba
Fix up 'clear recents' UX.

Use the 'dismiss all' button drawable and place the button in the upper
right corner. Doing so fixes the broken animation when going into
recents.

Change-Id: I497a8b023f1872c5f9ae5df87af6ed2159e6b7b1

Conflicts:
	packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
Framework: Forward port Long press back to kill app (2/2)

Change-Id: Ia88d8a2753e203afb8d6117a643c33127f991c4a

Conflicts:
	core/res/res/values/cm_strings.xml
	core/res/res/values/config.xml
	core/res/res/values/symbols.xml
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
that was a bad bad cherry pick
Revert "Framework: Forward port Long press back to kill app (2/2)"

This reverts commit 00a36285e657473c58227617ece0ea215422c719.
little bit of clean up
Merge pull request #7 from The-Ancile-Project/frankie-r7

pulling up changes from r7