services: don't clear wallpaper when SystemUI
disconnects.

When we restart SystemUI (or the user), sometimes
the wallpaper would get cleared. This patch just
captures its originating component and
if that is our SystemUI component, ignore the event.

Change-Id: I3e159dc2c013e7d7e552e3c0cef55e3ab970ca87
Signed-off-by: Roman Birg <romanbirg@gmail.com>
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
allow wallpaper cropper to read sdcard

Signed-off-by: ChampionSwimmer <championswimmer@aokp.co>
BootReceiver: Skip subdirectories inside tombstones scan

Properly handle (vendor-specific) subdirs under tombstones
directory by skipping over them.

CRs-Fixed: 407529
Change-Id: I0cecd9fa629fad35d62d508ddaf13968c2e46f93
(cherry picked from commit 1440830e6ea3097278bc74762f09a21854d1b416)
(cherry picked from commit e042bd6f036a6dd3af4924b9a9111d9499259ae4)
frameworks/base: move the traces file to avoid data loss.

If an ANR comes just after the framework reboot, the traces for
the framework reboot will get over-written with the ANR traces.
So, We are missing the traces for the framework reboot which
makes debugging the framework reboot difficult.

This patch will rename this trace file for the framework reboot
once the ActivityManager collects the traces.

Change-Id: Iee07b13ba02d8aab9cc43567aa5df131cc43c737
(cherry picked from commit 93348d7b1f48f1b3f6759bcff73153dce5709ded)
(cherry picked from commit 1c7cad9ce8b66eebe556c76c01a9396d449411cf)
frameworks/base: Watchdog to generate trace of Monkey

We need stacktrace of Monkey process to debug issues wherein
system_server gets stuck doing a binder call with monkey

Change-Id: Ie0be15662c68219fe5e95592c672b86ab0987e37
(cherry picked from commit c509d1147e321118f1c908502b0b9eb5ee2a5926)

Conflicts:
	services/java/com/android/server/Watchdog.java
frameworks/base: creating sperate files for ANRs traces

If an ANR comes just after the framework reboot, the traces for the
framework reboot will get over-written with the ANR traces. So, We
are missing the traces for the framework reboot which makes debugging
the framework reboot difficult.

Even for multiple ANRs in different apps, we will get the traces for
the last ANR.

Most of the time traces show that the call is stuck in some native call
and we do not have any info about the native call stack becuase we do
not collect the tombstones for teh ANR.

This patch will create one trace file for each application in case of ANR
and the filename would be traces_<app_name>.txt and the traces for
framework reboot will be stored in traces.txt

Change-Id: I5b78ce62b26f25d3dc14097e2988ba12c2d77826
(cherry picked from commit ea06416e430a85bef7cd21367e5948251f17c225)
(cherry picked from commit d678e40d53f0788b2883aa7c524da666ac2a8b4d)
Remove dependency on jniGetNonMovableArrayElements.

jniGetNonMovableArrayElements is not safe and is going to be deleted.

Change-Id: I6daae1e4ac9e01ca593cda522fdbeb774eef1eff
(cherry picked from commit 75a5038849cecf38aba72721272ff07cca09501f)
ActivityTrigger:  New class to invoke when activity starts/resumes

Change-Id: I46fa419e7b97953ba5581ee03127f0e3f93e48f0
(cherry picked from commit 71a57d30370584488a246a904750e7bdad5ba9a0)
(cherry picked from commit 5d2abff8e4d399e6bd320ea11bf672ad3b3be980)
(cherry picked from commit ffd89bcf976985acf0392c0dd667f8b5241d77ac)

frameworks/base: update perflock path name in Activity Trigger

Update the perflock path name and add
backup path for backward compatibility

Change-Id: I3d2c6f6fe1b3c63ec02827d06d5af667266db8d5
(cherry picked from commit 4db57e5021c4091352f40f6e4399b0b929f63151)
(cherry picked from commit b9fc7b99697a1b2f891dc642ff27c8a4194ca79d)
(cherry picked from commit 5910b639f0dea078049e31718e00bede2eb2ec00)

frameworks/base: update library path name in Activity Trigger

Change path from /system/lib to /vendor/lib
since it is no longer needed.

Change-Id: I5fa7a367b21d4128c92ab7190944c176a1f4dae6
(cherry picked from commit 7abea046455c1c8fc99126ae6cf9a6d4823ca50f)
(cherry picked from commit 5aadc3f081bef5b26b13e0bb4955354e3be0bcd7)
(cherry picked from commit 133db12892589a21865a900c3709073ed86eaf8a)

Conflicts:

	core/jni/AndroidRuntime.cpp
	services/java/com/android/server/am/ActivityStack.java

derp