SystemUI: ES translations

Change-Id: I0237f5fcd9ee924653524546208ef02e3cd57410
SystemUI: translation too long fix

see here: https://plus.google.com/u/0/116635047487375994737/posts/JLfLjXwrp9w

Change-Id: Ieae2c2578178f3c82d3535f5bd0b7c6e30729ce3
Keyguard: Fix configuration change observer

Change I9e5dfdb12df522dc7dd50c26f35aba26b1bbe44e made recreations
only happen when a stored copy of the previous configuration differs
from the current one. But "configuration = otherConfiguration" creates
a reference to the original object, not a copy, so newConfig.diff(mLastConfiguration)
always returned zero. Fixit by creating an actual deep copy of the
Configuration object.

Change-Id: I236932dfc0e121dd83212882b4fe71306c8a3fab
Core/Keyguard: Cleanup CAF additions

Change-Id: I12619aedc459ffed514b1eb2c19dd57e6f535522
Avoid collision with RIL constant 1138, used in some Samsung devices for RIL_UNSOL_TETHERED_MODE_STATE_CHANGED.
Needs http://review.cyanogenmod.org/#/c/61292/
Thanks to iptux on XDA for pointing out the change in constants between
CM-10.2 and CM-11.0.

Change-Id: I64011408f4cce9aeb1b56e325226f8e649eff2b6
msim: Add support for H+ icons

Change-Id: I9e0cb93b0414f55c51aea7425ab8e02ef5f12095
Augment SELinuxMMAC functionality.

* No longer support a package name stanza outside of
  a signature tag. Package names, by themselves, have
  no security associated with them in Android and thus we
  should not be allowing or encouraging this
  type of policy.

* Allow for nested package name stanzas inside
  signature stanzas. There are cases where a finer
  distinction needs to be made among apps signed with
  the same cert. New code allows a different seinfo
  tag to be assigned to the listed package names
  signed by the parent cert. When a determination needs
  to be made concerning seinfo assignments, the inner
  seinfo tag takes precedence over the outer seinfo
  labels which are assigned to just the signature.

* Temp structures are now used to parse new policy files
  until the entire xml file is parsed and deemed correct,
  at which time the temp structures are copied over to the
  permanent class structures. This ensures that any structural
  errors with the policy will not result in partial loads.

* Valid stanzas look like the following with the inner
  package piece being optional.

   <signer signature="">
     <seinfo value=""/>
     <package name="">
       <seinfo value=""/>
     </package>
   <signer>

   <default>
     <seinfo value=""/>
   </default>

Change-Id: Ia204d71211776dcf9b2dcc86ad6d77c4ad39dc25
Allow PMS to restorecon directories under /data.

This change applies a relabel to both /data/data and
/data/user directories on boot. Not every boot will
apply this relabeling however. The appropriate
seapp_contexts is hashed and compared to
/data/system/seapp_hash to decide if the relabel
should occur.

Change-Id: I05e8b438950ddb908e46c9168ea6ee601e6d674f
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
Convert all selinux_android_restorecon and _setfilecon calls to new API.

libselinux selinux_android_restorecon API is changing to the more
general interface with flags and dropping the older variants.

Also get rid of the old, no longer used selinux_android_setfilecon API
and rename selinux_android_setfilecon2 to it as it is the only API in use.

Change-Id: I1e71ec398ccdc24cac4ec76f1b858d0f680f4925
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Fix WifiHandler for MSim

Commit 7c26a5cce74332bc48da9e894a835f2fe795431c attempted to fix
this issue by adding back the old code, but it needs to be a method
that can be called by MSimNetworkController. So sync it back to caf
to fix the merge issue.

Change-Id: Ifc721cbf372ec50810924d7ac6d55f54663458a1
Fix CYAN-3555 bug

This commit fixes typo which is in AOSP tree.
I hope it's possible to merge it.

Change-Id: Ifdf9c5d90b9850b6112ee11a9b1aa3b1576348a0
Signed-off-by: jereksel <jereksel@gmail.com>
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>
SystemUI: NL translation

Change-Id: I3471bc2333cb9e9e8d5f2325dd91239c37dc4d5d
Base: Mirroring layout on RTL languages [1/2]

When Force RTL layout (in developer options) is sellected on RTL language (Arabic, Hebrew, etc) - mirror back to LTR.
There is another commit (same name but with [2/2]) which just changes the strings to match the new meaning for RTL languages.

Change-Id: Ib051b976db4e15dab9caddcd0d49276b5ada3f13
Frameworks: fix possible NPE + and missing expandable panel

Steps to reproduce for NPE:
- go into volume style settings
- switch to disabled
- switch to expanded
- NPE and hotreboot

Fix:
Check if mStreamControls is initialized and if not lock it and do it.

Steps for expandable error:
- go into volume style settings
- switch to disable
- press one time the volume button
- change to expandable
- change the volume and press the expanded icon
- result is it does not expand and is empty due of the missing volume panels.

Fix:
- if it was changed from disabled to expanded be sure that the additional volume panels
are recreated.

PS:
- fix another exception

Change-Id: I58d63d34f831b6a6f60f6eddb3a07fc916d464f3
ConnectivtyService : Execute connectivityCheck in thread pool

Since this async task takes long when doing things like waiting for
network connectivity...etc, rather than holding up the single executor
of async task for the framework (app_process), run it on a thread from
the pool so other tasks can execute in parallel.

Change-Id: I7b88a4837c7e117ef47014a20c57f828b811edfb
frameworks/base: Fix the random UI corruption

On low memory device, when a view goes to background. Its HW layer cache
will be destroyed to release memory. There is a very rare case that the
hardware render is not valid when destroy the layer, so the layer is not
destroyed and reused when the view comes to foreground. But the GL
context has changed, so the view is not rendered correctly due to its
HW layer cache. To fix this issue, destroy the layer in a safelyRun. Make
sure the layer is destroyed correctly.

Change-Id: I1c714e1d53db7353d5169e874a7cd0f527c3f67b
CRs-Fixed: 623239
Squashed commit of QuickBoot feature from Qualcomm

QuickBoot: don't log boot events when in QuickBoot mode.

Don't need log boot events when booting from QuickBoot mode.

Change-Id: Id381530418c09ac1d650f45e7a368dbd7945aff3

QuickBoot: don't wake up screen when usb connected

Don't wake up screen in QuickBoot mode when usb connected.

Change-Id: If65936a0edbbc3b36a0768294e5c3bd7d741018a

QuickBoot: filt out alarms that for non-system users

Don't allow alarms for non-system users when under QUickBoot
mode.

Change-Id: I322d08f7236b6895462c4cd3304326c66f67ddd2

QuickBoot: restrict app's auto start under Quickboot mode

Don't let broadcast trigger apps auto start when in Quickboot mode.

Change-Id: I5d156cbea4ef18397ce4569cb74f73a446a6e49b

QuickBoot: remove alarms for killed apps

Device may be woken up by WAKEUP alarms, which have been set
by those killed apps before. Here to get the killed apps list
and remove the alarms from AlarmManagerService.

Change-Id: Ib34f5fc234b834b2fe4528229c267c8693fc76cb

SyncManager: Fix SyncManager null pointer issue under QuickBoot

BOOT_COMPLETED broadcast will cause mBootQueue null pointer issue.
Then system_server will crash. Add protection here to avoid
system_server crash.

Change-Id: I78029dfa90709455e4c2220e06b95640383655f8

QuickBoot: add execption restore mechanism

There may be some exceptions like battery unplugged When device
is put into QuickBoot mode. Then device will be in airplane
mode after next boot. We don't want such kind of things happen.
So start restore task to check if need restore before main
screen shows.

Change-Id: I3d0967c2f446fd71eca87ff085617edca549c984

QuickBoot: switch normal power off to quickboot

Handle power off button when quickboot mode enabled.

Change-Id: I6a668cbe823018b5e508633a76202d0df0381694

QuickBoot: support QuickBoot power on

Support long press power key to power on when in QuickBoot mode.

Change-Id: Id493d352bce73683b9696a2685a6c902f1195799

QuickBoot: Don't handle SHUTDOWN broadcast from QuickBoot

Don't process the ACTION_SHUTDOWN broadcast sent by QuickBoot.
It is only for apps.
Change-Id: I73d1a7b8edda0a898dd052831033806e18b37c99

QuickBoot: rename some intents and broadcasts

Modify some improper names for intents or broadcasts of QuickBoot.

Change-Id: I92357b0110643bb425199452cb03bd75248a5d83

QuickBoot: Support poweroff alarm under QuickBoot mode

Add white list in QuickBoot mode to support poweroff alarm.
    1. Allow original deskclock app and quickboot app to be launched.
    2. Don't filter out deskclock's alarms.

Change-Id: Ie4254e3da45837d3185d3daba625a42c50fd7f52

QuickBoot: enable poweroff charging under QuickBoot mode

control native charger's enable/disable under QuickBoot
mode.

Change-Id: I4f80c74b042e03bddc9f7fe419f4ed1f8b1409d5

QuickBoot: Add wakeup check under QuickBoot mode

We only want QuickBoot application to wakeup screen in QuickBoot
mode. Add wakeup check to filter out other wakeup callers.

Change-Id: Id82a0938003d2a776efda0e39a57877f41fc1ee4

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
	services/java/com/android/server/power/PowerManagerService.java

Change-Id: Id82a0938003d2a776efda0e39a57877f41fc1ee4
Proper security labeling of multi-user data directories.

This patch covers 2 cases. When an app is installed
and the resulting data directory is created for all
existing users. And when a new user is created and
all existing app data directories are created for
the new user.

Change-Id: Iaba7c40645bc7b6cc823d613da0c3782acf6ddd5
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
quickboot: Only enable QuickBoot if package is installed

 * Also move to Settings.Global

Change-Id: I87e1464d717b41437072523c0ecab52227d7888b