Fix theme provider crashing for non-primary user.

PackageManagerService's context is for user 0, so if the theme provider
for other users was invoking the getInstalledThemePackages() method, the
themes provider crashed as it doesn't have the INTERACT_ACROSS_USERS
permission.
Fix that (and simplify code) by making getInstalledThemePackages()
return the installed themes for the current user, which was probably the
intent anyway.

Change-Id: I02002cee005b74128f3b2f7cc7a93b9b8514f1f3
ThemeUtils: Retain the original package name in themed UI context

In order for themes to reflect on system elements, we're changing
their context, including the package name.

This breaks anything that tries to identify system elements,
most notably any users of the uiautomator. Trying to do
'UiSelector().packageName("android")' to find, for example,
a force-close dialog will fail.

Fixes com.android.cts.uiautomatortest.CtsUiAutomatorTest#testUiWatcher

Change-Id: Ic05c3024b20ac3772ed5597846fbfa4a184ebb0d
SystemUI: Reinflate on theme change

Reflect the updated assets immediately once the config_changed
notification happens

Change-Id: I480a719fbdd45875277871af39ce65849918ec0a
Signed-off-by: Rohan Mathur <rohanmathur34@gmail.com>

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
Framework: Remove orphaned Theme related code

Change-Id: I930d4cc75e655c5bc37532e6a1425d27bd1ee661
Signed-off-by: Rohan Mathur <rohanmathur34@gmail.com>

Conflicts:
	services/java/com/android/server/NotificationManagerService.java
PackageManager: Let com.tmobile.thememanager access privileged permissions

Needed for CHANGE_CONFIGURATION

Change-Id: If50b0926d77e15e18ef5e88d7efac1b7f209d6e4
ResourcesManager: Fix theme insertion at boot

This was lost during the 4.4 ActivityThread reshuffle, put it back

Change-Id: I96eadf691973e9a2daa099b55816fc103d129be7
platform: Fix the gid for the theme manager service

It was mismatched with fs_config, resulting in attribution of the
"-1" gid

Change-Id: Ia6d55af0b39f659da2965f9bc0bda0df5c775ba4
PackageManager: Prevent themes from going into ASEC containers

Themes on ASEC cause all kinds of random timing/racey issues at boot
time, and more kinds of racey concurrency issues at uninstall/upgrade
time. Stop them from getting into containers at all.

Change-Id: If08e90c51137b22239831a4eca17ea00d5d87d93
Framework: fix theme engine merge

Change-Id: If4b0934722a113b63f0e18598799366510169a88
Signed-off-by: Roman Birg <romanbirg@gmail.com>

Conflicts:
	services/java/com/android/server/NotificationManagerService.java