@hide API change from themes

Change-Id: Ia0798346d2e8e5a84e8456bb89b7d503a71a7afa

Conflicts:
	core/java/android/content/res/Resources.java
GlobalActions: Fix dialog dismissal

The themeability of the global actions dialog introduced by
change I644e2e8d7d4abf07bae639b606197d691f16adac broke the
hook that prevented multiple instances of that dialog, and
multiple instances of it will cause framework crashes due to
mismatches variable references (besides looking weird).

Fix it by restoring the original dismissal condition and forcing
a recreation of the theme context if necessary.

Change-Id: Ic6e06bef18fa9e09c84c774fa273f1b7e3bf9630
Check themes of current user, not user 0.

Change-Id: I5d685a04289b434a12e460b4fdacc43a41ff2be1
JIRA:CYAN-1303
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
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: 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
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
Frameworks: Update DocumentsUI for theme chooser combatibility

PS2: credit: djdarkknight96
PS3: this time, use the correct owner info
PS:4 fix typo in styles.xml

Change-Id: I121099de6c09d33ef9f02019996eac1c6f1d3731
base: Add theme support to Ringtone and Profile pickers activities

Patchset 3: Add support for theme RingtonePreference view. The dialog is
            automatically adjusted to the caller activity base theme.
Patchset 4: Don't break the android api

For Ringtones:

http://review.cyanogenmod.org/#/c/61393/

For Profiles:

Usage:

Intent intent = new Intent(ProfileManager.ACTION_PROFILE_PICKER);
intent.putExtra(ProfileManager.EXTRA_PROFILE_DIALOG_THEME, R.style.CustomDialogTheme); <<< Add your custom dialog theme here
startActivityForResult(intent, 0);

Style Usage:

Define an style that inherits from an android base theme

<style name="CustomDialogThemeDark" parent="@*android:style/Theme.Holo.Dialog.Alert">

or

<style name="CustomDialogThemeLight" parent="@*android:style/Theme.Holo.Light.Dialog.Alert">

or define your own dialog style

Change-Id: Icadbcf2c617c51177466989acdab9435066a47a0
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>

Conflicts:

	core/java/android/app/ProfileManager.java
	packages/SettingsProvider/src/com/android/providers/settings/ProfilePickerActivity.java