Fix systemui crash on boot

The process com.android.systemui would crash after phone booting with a
java.lang.NullPointerException when the signal status style is set to text

Change-Id: Ia7b58fa93b8591d0571b90a57a2fe0fe823b3f45
Fix ResourceNotFoundException when updating  applied theme

If the user has a theme applied and there is an update to that theme,
then the themed apps will crash. This is because the theme's APK path changes,
but the apps do not update their resources. Apps were not updating their resources
because updateConfiguration() determined that the config (which only has pkgName) hasn't changed.

The problem is fixed by first applying the default theme config and then re-applying the
updated theme.

SystemUI was crashing with a NPE while verifying this fix, so a NP check was added to SystemUI as well.

Change-Id: I00e32fc1535b4d279fcb37c35f868501ecc1dd19
IconPackHelper: Respect the original size of bitmap icons

When use icon packs on low-resolution devices, for example, my HDPI
phone, it seems that using the size returned by
getLauncherLargeIconSize() will cause a blurness on
some icons that are not included in the icon pack because of the compose
function.

This patch respects the original size of the icon if the icon is an
instance of BitmapDrawable but use the size returned by
getLauncherLargeIconSize() if the icon is an instance of PaintDrawable.
This will remove icon blurness on low-resolution devices.

Change-Id: Ifcb39020d934a9c7cb409e1206a179d64f99aa37
Respect DPM when deciding whether keyguard is disabled by profile.

Change-Id: I2fd50e1edd517956a59770a2ecd754cea0003c1c
Restore lazy loading of LoadedApk resources

This was broken in 8fff544ec349593cfa61ae2f5ec59419fff666b6. Since that change,
resources are always initialized in getPackageInfo(), even if they haven't been
loaded before (mResources == null).

It shouldn't be necessary in *any* case to preload the resources at this point.
Anything using the resources should call LoadedApk.getResources(), which will
initialize them just when needed. Setting mResources to null resets the cache
and will force a reload the next time the resources are requested.

Change-Id: I9bc9986297478e99752b1e2b9bd04dab3dcc9656
AudioService: Show safe volume panel for non-interactive volume adjustments

If safe volume is active, apps calling mp.setVolume() to adjust the
headset to a value higher than the threshold will have the operation
fail silently because no volume dialog is active to pop up the
"do you wish to override" question.
This is particularly bad for peripherals that use the audio jack
(Square readers, Jawbone bands), since they usually require levels
close to maximum for proper communication and the app isn't prepared
to deal with a silent rejection of the requested volume.

Change-Id: I2047d199506106a87841b8b680007c5ab45b527b
Remove clock seconds [1/2]

Revert "Clock: use mCalendar to get seconds"

This reverts commit 8eef10bb95173a74b00a4b9240aa44fe154dd090.

Revert "Show Seconds next to StatusBar Clock [1/2]"

This reverts commit 50c5872707e487f3402eead3de59cc216d488ec1.

Change-Id: I5e1ad1b1054cf133c53f2194877b29efc0a300f6
Themes: Support applying components from multiple themes [1/3]

The current implementation assumes the components being passed
into the ThemeService belong to the same theme.  This patch uses
a Map instead of a List to pass in a mapping of components to
package names, allowing us to apply several components from
different themes.

Requesting a theme change now takes a Map<String, String> which
maps components to the theme package name they will be applied
from.
Example:
    Map<String, String> componentMap = new HashMap<String,String>();
    componentMap.add(ThemesColumns.MODIFIES_ICONS, "com.mytheme.blue");
    componentMap.add(ThemesColumns.MODIFIES_OVERLAYS, "com.mytheme.red");

    ThemeManager tm = (ThemeManager) contex.getSystemService(Context.THEME_SERVICE);
    tm.requestThemeChange(componentMap);

TODO: apply changes for lockscreen wallpaper
Conflicts:
	services/java/com/android/server/ThemeService.java

Change-Id: I13fa17eabecb824884fe522d5dc1822a4d7c55f4
Add missing center clock layout to MSim status bar

Change-Id: I8b184d98694d3445c58bcbf53bc3866795607a69
Fix Build

Give the sleep command some parameters if it wants them.

Change-Id: I1cfbf94cf06cc19088de2a4a6d1b56492bb2ab43
Fix keyguard not respecting security set by profiles

Change-Id: Ibb4aa7ca217c08945974c88f3f30aca9cf14728a
base: update link ring-notifications after read user settings

Change-Id: Ib424124dc20e38243e572333e323ba97aacb1111
JIRA: CYAN-3559
Issue: https://jira.cyanogenmod.org/browse/CYAN-3559
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
msim: Add missing changes from New Theme Engine [1/6]

Change-Id: I52051a8cefd0d4632d2a2255a03689cc037e6995
Catch all exceptions when retrieving ComposedIconInfo

It is possible to receive a TransactionTooLargeException when
getting the composed icon info from the package manager service.
We should catch these exceptions to avoid unnecessary crashes.

For reference:
The Binder transaction buffer has a limited fixed size, currently 1Mb,
which is shared by all transactions in progress for the process.
Consequently this exception can be thrown when there are many transactions
in progress even when most of the individual transactions are of moderate size.

see http://developer.android.com/reference/android/os/TransactionTooLargeException.html
for more details.

Change-Id: I70d35dc4926125bfbef5d8c5fb8ed6d6fcdbf159
AudioManager: Add Bluetooth A2DP profile trigger

    - Introduce a new profile trigger for Bluetooth A2DP
      connections.  We can't use the default ACTION_ACL_CONNECTED
      because it would apply the volume settings before routing
      has been established to the A2DP device.
    - Modify AudioService to send an intent after the audio
      route has changed to A2DP to ensure our volume change
      will apply to the correct device.
    - Allows the user to disable the A2DP profile and still
      trigger the profile change.

Fixes JIRA issue: BACON-47

Change-Id: Ib51dac6d79abbaf494b86af4480e293162814459
QS: Make CameraTile respect locale changes for the label.

Change-Id: Id4be230c443263b4185e5b4af6e8df6805a7aac5
QS: Make PerformanceProfile Tile respect locale change for label.

Change-Id: I5afaa0c0f468e3b79f5b22c4c2804463d7a16651
improve a calculation method for LTE antenna reception level

This proposal will fix a problem that Android devices could
show different levels of antenna bars under the same radio
environment if each device uses different modem.
This behavior makes confusion toward users and others.

That behavior comes from using RSSNR as a metric for
determining antenna bars. Unfortunately, RSSNR does NOT define
performance requirements and error tolerance level in 3GPP.
Therefore, accuracy of RSSNR measurement could be inconsistent
among Android devices or modems.

The patch we would like to contribute here will be offering
Android device to use RSRQ for antenna bar metric instead of RSSNR.

1.)RSRQ, like RSSNR, takes interference into account
   when measuring the radio quality.
   Android already supports measurement of RSRQ.

2.)The performance requirement for RSRQ is already defined in 3GPP.

3.)DOCOMO and other many mobile operators use RSRP and RSRQ
   when designing LTE coverage areas, and alignment here will
   be very beneficial for both users and operators.

Hope this patch helps to improve Android antenna bar accuracy and consistency today.

Change-Id: Id1c3339764294ef51365ab133a1c7b42e14e1800
Signed-off-by: Kensuke Ueda <uedake@nttdocomo.co.jp>
InputWrapper: opt out early if session == null

Change-Id: If111195ba6425ad6b8663601566f9f260738ec77
fb: respect config_animateScreenLights and fade out if set to true

Currently if config_animateScreenLights is set to true the settings entry is not shown
but the default animation is not fade out which it should be in this case.

This commit fixes this.

Change-Id: I02dfa15d65bc6da30f4e19fbf4698a669cb0e2c8