msim: initialize sim icon to the known state

- When system ui gets killed (for instance, during a theme change),
  MultiSimNetworkController may not receive the SIM_STATE_CHANGED
  for both sim cards.  Instead of initializing the sim to "ready",
  query for the actual state at initialization

Change-Id: Ia7f63827bbddca77de3daf4d5d149ec79ab91d5d
Add support for single color notification LED (1/2)

Change-Id: I367af77036da9e87c6dd0df552ce4c56d945a44d
Access ProtectedAppsActivity from SystemUI Recents page if any components are protected.

Change-Id: I873b471babaa802bc4caabbb3c3a23da9555df57
SystemUI: Fix RemoteDisplayTile crash on clean boot

Previously a patch was put up to fix adding/removing tiles due to a race
condition and not checking with the executor was still active at the
time of onPrepare(), but we did not add the check to unPrepare(). This
bug only seems to surface on a clean boot.

Add the same check to unPrepare() to avoid crashing.

Change-Id: I7485ebed41aac94987305b436777bec45beac762
Signed-off-by: Roman Birg <roman@cyngn.com>
frameworks: fix setting default ringtone for multi sim

The defualt value for the ringtone expects a "_" between the setting and
the requested sim subscription. This was not being respected in the
mediascanner when it set the default ringtones, resulting in the setting
value being "ringtone2" instead of "ringtone_2".

Change-Id: I4a9147d579183229cc3300e71194e6f5ab74fbc6
Signed-off-by: Roman Birg <roman@cyngn.com>
Automatic translation import

Change-Id: I7d0558e52d0fe54b2dc5df11201b7bb128407a6a
linearlayout: fix measurement of childrens when parent and childrens have exactly the same pixels

When children measure exactly the same width/height than the parent, any child with
width/height == 0 and with weight > 0 must be reset. Otherwise, the view will retains
the same width/height between measurements calls (that is not valid if the view changed
its orientation).

This explain the bug in CYAN-5471 when in hpdi devices the spacer view has the same
width after rotate from landscape to portrait when language is german and date beewteen
September 10-30. Steps to repro in i9100 (hdpi):

1.- Set language to german and date to September, 10.
2.- First run, the expanded bar has the same width that its children (480px the current
screen size), but spacer has 0px (because it isn't being measured by linearlayout).
3.- Rotate to landscape, spacer gains space and all buttons are displayed correctly.
4.- Rotate to portrait, spacer has the same width that in step 3, because it isn't measured
again and delta == 0;

This patch forces this views to be re-measured to 0 to match the current delta (the views doesn't
need to be expanded or shrinked).

JIRA: CYAN-5471
https://jira.cyanogenmod.org/browse/CYAN-5471
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>

Change-Id: Iab60337eca6ded7b2b4d57fdcc95863be461db34
Improve screen timeout QS tile

 * Use com.android.internal.R.plurals.duration_* for text
 * Use white icon as suggested here https://jira.cyanogenmod.org/browse/CYAN-3769

Change-Id: Idfedbc1e7a857dbfa05736810e09528852c8bfa3
Use actual storage type for format message strings

Change-Id: I214120303bf6c12c297332fa314ce80bc686da46
perf: Send boost hint during initial launch

Change-Id: I26afc909c35e514958894b0a07a650a20ce6e537
WIFI: Fix wimax teardown when wifi connected

Due to patch:
https://github.com/CyanogenMod/android_frameworks_base/commit/f769f4cbc2aaac8d9d49f9ff79a6fe0affc4ff6e

Change-Id: I18e5ced62c8e4976f7a6835ba8c593930dac0586
Global Settings (MSIM): Add global settings for naming sim cards

Change-Id: Ibbd0d48042a92f82241a4ccaee12a81ca13ccdb4
SystemUI: Fix crash during notification/theme change

Fixes crashing that could occur when a notification is created
during a theme change. Entries were attempting to be added
to views which did not have a layout pass yet, causing it to fail.

When a theme change occurs, the fix is to halt the ticker and command queue
until a layout occurs.

BUGDUMP-151925

Change-Id: Ic19d26178df673a1d52981a8617415e6fbcb219d
core: Improve strings

* Follow the guidelines

Change-Id: If4dbfe00036d65dc56b7852ec5ddbfbe72c921a0
keyguard: fix chopped layout on hdpi msim devices

* adapted from commit fa06992ab7e49fe1e056787dd281384d92290be1

Change-Id: I23ebb212c96e3ef8aecebb43760cbea7d441b1fd
Revert "Bypass the lockscreen when the hardware keyboard is slid out and security mode is 'none'"

This causes issues, documented in CYAN-5567.

This reverts commit c12204450f41eb3a6175b5fae7f1a853c059c6eb.

Change-Id: Ic9478eadbfa830e869007dad17983bd33c0ac6d6
radio: Treat REGULAR_DEACTIVATION events as transient errors on AT&T

Change-Id: I6872be05de01dbe41d923f4274b70414f65d5f7e
MultiSim: move getFormattedSimName() to frameworks (2/2)

Move this into one location any app can call.

Change-Id: I02a96f72be1e41783faeb5862cb26b96ca776672
Signed-off-by: Roman Birg <roman@cyngn.com>
Add system|signature permission for intercepting package launch.

The preLaunchCheck (add, remove) functions which allows an application to
perform any checks before the framework launches the app
needs to be a protected with a system|signature permission.
This change defines the permission and protects the functions with it.

Change-Id: Ib62e25b780df39c4a7d9d1e4eaf3fc98ffa4089c
PackageManager: Add configuration APIs for pre-launch checks

This change replaces overlays with an audited set() API, allowing
application with INTERCEPT_PACKAGE_LAUNCH permission to bootstrap
themselves.

Additionally, checks have been added to ensure that the custom prelaunch
check activity always resolves to a valid target.

Change-Id: I7f6be647fde3ce4ed699e6abfbe0392176ec96d3