Fix crash while installing themes rapidly

A theme can be installed on a PM or theme service thread.
If multiple themes are being installed at once and one of
those themes happens to be part of the boot config, then
two themes will try to be installed at the same time. This
causes problems with files like the temp AndroidManfiest.xml
which are not designed to be multi-thread safe.

This patch fixes the issue by making sure a theme is
never installed in a PM thread except during boot.

Change-Id: Ic9a0ffe43d0199a2a893579f3d2dbb6d9340e7b4
(cherry picked from commit 6b675187aa589990641c83c411909ee6237acbf4)
Sanity-check paths of files to be restored

(cherry picked from commit 7d51cc701a6735cf455af8479f56c9c0b2109e02)
Bug: 16298491
Change-Id: I0c2d6523c9d152dad4d27d06d3853afd432e5af7
(cherry picked from commit f4f23695182e5802e20326bb10e6966e7253542e)
Tether : Update settings app reference

Change-Id: I1726be0de702e688326b74ee262d9f674ff8e014
(cherry picked from commit 44af4824fdc10a24791bf76f2ddf1c98a7e49810)
SlimRecents: 'Delete application' development shortcut

https://github.com/CyanogenMod/android_frameworks_base/commit/6cfa3cb2e576bb7ddcac80c1a5ad48c00b8ed574

Change-Id: I1ded638fca735cf78923b25ffa231e474e4dba9c
(cherry picked from commit 62dcef1bb138f1076b9128e050954ec3849b2ddf)
pm: use 'available cores' instead of 'available cores + 1' for multi-threaded dexopt

Linux kernel's CFS scheduler does a better job when
the number of workloads is equal to the number of CPU cores.

Since dexopt almost always takes 100% of CPU cycle,
we can expect faster dexopt operation with CFS scheduler
at its best.

Signed-off-by: arter97 <qkrwngud825@gmail.com>
(cherry picked from commit 6733719b84cf7fd18c3687dbb160f568ccb45ad1)