remove some lag launching apps and improve scrolling

Change-Id: Ib10c11a1a3a798e57ddd31f550461b9ebd17bc38

Conflicts:
	core/java/android/widget/AbsListView.java

Conflicts:

	core/java/android/widget/AbsListView.java
Fix some activity manager derps
To fix fatal exception in system process due to NullPointerException.

Null pointer check added to avoid NullPointerException, that was
leading fatal exception in system process hence framework rebooting.

Change-Id: Ia83a6178bd575954345020ef3a792a3445323808
CRs-fixed: 483763
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: Iec2daee0350b20571d0bda9330a17a68df194f8b
Fix 4.3 merge derp fail
BT: Fix memory leak when BT on & off done many times

Solves a memory leak in BatteryStatsService when Bluetooth
is turn on/off. Solution adds missing close of proxy then
Bluetooth is turned off.

Change-Id: I65f9db298459c7c15f6a10c752992f1d38469445
CRs-Fixed: 476145
am: Allow more hidden apps on devices with lots of RAM

 * If more than 1.5GB is present, allow up to 40 hidden apps.
 * Number is somewhat arbitrary, but was found to work well on D2.
 * Also look at the sys.mem.max_hidden_apps value if given.

Change-Id: I2d3cf6e0dad1bc0b482cc37bf9c61ed2f2b4be51

Conflicts:
	services/java/com/android/server/am/ProcessList.java
Add missing theme chooser code
Fixup some package manager derpys
Fix for rare INSTALL_FAILED_INSUFFICIENT_STORAGE bug

This fixes a bug that occurs when one application
update fails to remove the old application package
causing any following update attempt to fail falsely
reporting insufficient storage.

Change-Id: Ib94110bcc82ff092ac630e929fde81136425159e
missing package manager debug stuff
Cleanup/Fix power management services
Fix reboot window texts

PS2: move assignment of titleResourceId into the condition and
only query longPressBehavior when it's needed.

Change-Id: I00c3940c2b5472434177e94ab7c72d5fecc61b2e

Conflicts:
	services/java/com/android/server/power/ShutdownThread.java
Framework: Show the Advanced reboot menu only for the primary user

Change-Id: I73f82eade26f268e2b4608fa23cabcf0bb8fc862

Conflicts:
	services/java/com/android/server/power/ShutdownThread.java
Missing wifi service country code
Fix awesome animations import location
Fix many window manager service derps