Prevent factory reset for short passwords in CryptKeeper

Since patterns and passwords can't be shorter than 4
elements, we shouldn't count them against attempts to unlock
the device.  If we do, we risk resetting the device
due to stray input.

Bug: 18211475
Bug: 18273380

Change-Id: Ib329cd3383471483cda68bfac4278b17d0c09c57

Conflicts:
	src/com/android/settings/CryptKeeper.java

Conflicts:
	src/com/android/settings/CryptKeeper.java
Improve notification tone string

Change-Id: I731903a7bcda38229502de33dbc83c44e3782996
Protected Apps: update protected apps screens UI

Change-Id: I2dd922956f8ffd9ed153c3d1aa1f9161a127e4c6
Remove unnecessary drawables for launching Protected Apps

Change-Id: I58f471ef9d64c7ced79befbfc30b94d75a0085a2
Move Blacklist and Notif Filter to Privacy

Match CM 11

Change-Id: I5e3f9c26b68a89ba1622d95e2d0e4f4a93361c5e
Merge tag 'android-5.0.1_r1' into HEAD

Android 5.0.1 release 1
Development Settings: fix Advanced reboot not being updated on resume

Change-Id: I5475bec978c9cf50c02769091dbb43c6eff6c020
privacy: Actually set the blacklist preference

The preference was not being set, which caused this code to throw an NPE on
devices without telephony when opening the privacy preferences.

This bug also affects devices with telephony in that the preference doesn't
update its text. I also got rid of the null check because the preference
always exists, the null check is pointless and ended up hiding this bug.

Change-Id: I95555d44349700a8f29a71a2f2ee9aedf419b49b
bluetooth: Don't crash when the local adapter is not set

In devices where bluetooth is not working (like the emulator or devices
in development), the bluetooth Settings crashes when closing the activity.

Most of the code checks for the nullability of the local adapter except
for this particular piece. This is usually not a worry for production
devices and I wouldn't usually worry about this but since the rest of the
code performs the nullability check it seems silly to crash onPause.

Change-Id: I7c1d3b43969b516336be770957008ef2054d312f
Settings: squash of new profile UI for cm-12.0

Additions for cm-12.0:
- removed expanded desktop
- added add profile FAB
- updated tabs for meterial style
- added enabler switch bar

Squashed commits:
-------------------------------

Settings: refactor Profiles to be more user friendly

* Remove the notion of Profile app groups
* Rearrange profile setup flow, now we first present the user with ways
which will trigger the profile, then allow them to set what happens when
the profile is triggered.

Change-Id: I2870df894046cd43c21c67991fb5efc9c3fec837
Signed-off-by: Roman Birg <roman@cyngn.com>

Settings: cleanup new profiles UI

* cleanup old code
* for configuring profiles, add options to modify triggers and remove
the profile
* remove separate activity
* don't hardcode padding pixel sizes

Change-Id: I6b1d05c9f918714249411006c7562496e2a7539e
Signed-off-by: Roman Birg <roman@cyngn.com>

Profiles: fix expanded desktop settings not applying

Change-Id: Ia523145bf47bfc189c29b035ad5ec6e053cf9296

Settings: Fix profiles volume override summary.

Change-Id: I499cfb3006a7fc7b5e931ac854a7437f5d141523

Settings: fix Profiles expanded desktop choice mapping

Change-Id: Ib96811a0c268ca68a7b9732283c5abc142d143a4
Signed-off-by: Roman Birg <roman@cyngn.com>

Settings: add "Untouched" ring mode option in profiles

Change-Id: I4ac2d63119b328533217104a799cb0660ecddfb9
Signed-off-by: Roman Birg <roman@cyngn.com>

Settings: profiles: fix volume streams override behavior

Before we would always assume to override the stream, but that is not
always the case. Add a checkbox to turn the override on and off.

Change-Id: Ic1a58d59a9e514d4c2ccf376191ac7989bbead26
Signed-off-by: Roman Birg <roman@cyngn.com>
Cleanup Security/Privacy settings code

Cleanup:
* Mismerges
* Code style
* Copyright headers
* File permissions

Change-Id: I6c34586680f0ccbaa613a0acfee366113c32a81c
Settings: use CMHW serial number

See http://review.cyanogenmod.org/57164

Change-Id: If328ca7b487435b88246d1f8c47b04770183f09e
Settings: allow home button to wake device [2/2]

Change-Id: I5c887422636f8bc51cb324339b3cdcac7af54400
[1/2] Settings AppOps: show/hide app type and allow/deny counters

Squash of:

Author: Sam Mortimer <sam@mortimer.me.uk>
Date:   Thu Oct 3 13:51:31 2013 -0700
AppOps: menu options to show/hide user and system apps
Change-Id: Ia55364c361db949a891e4b53a757ee4dff519eb6

Author: Sam Mortimer <sam@mortimer.me.uk>
Author: Danny Baumann <dannybaumann@web.de>
Date:   Wed Oct 2 22:24:14 2013 -0700
[1/2] AppOps: Show allowed/ignored counts
Change-Id: Ia27737155c33e934df9a2a1fcff88379240fd096

Author: Sam Mortimer <sam@mortimer.me.uk>
Date:   Sun Dec 1 21:39:07 2013 -0800
AppOps: only apply app type filters to summary screen
    *) If buildState() is called for a single package, do
       not apply hide user/system app filters.
    *) Fixes show detail display when called via
       long press in privacyguard and an AppOp hide
       filter is ticked.
Change-Id: If31d094fb989836ab6829daeefe820695032c0ed

Change-Id: I4d6f37b3923eb9bc98d67101d6f0ef481a427682
profiles: Make the actions wizard buttons show up

The "back" and "finish" buttons weren't being shown at all in this
layout, which made it impossible to add profiles.

Change-Id: Ib6b52430c25ed7445ca8e3c1249b7fccd21c3c69
profiles: Make the floating action button more material-y

This makes the FAB look consistent with other fabs across the system,
it adds animated elevation, changes the icon color to white but mainly
fixes the size which was completly wrong.

Change-Id: Ib8b2d54869a6a10958c24bcc0fab1224fd07fadd
TrustedCredentials: Don't crash when the activity is paused

If you press Settings -> Security -> Trusted Credentials, then press
 back before the loading finishes, the loader async task will still
try to dereference the activity which will cause an NPE.

This patch fixes that by getting and holding a reference to the
context in the beggining and bailing early if it is null.

Change-Id: Ie03734d5f184821df5d8729fc4a16eb51cdeebf5
Answer call with hardware HOME button (1/2)

Squashed commit of the following:

Author: Oleksandr Byelkin <sanja.byelkin@gmail.com>
Adds ability to answer call with hardware HOME button
preparation to winter time
Change-Id: I0d22a6fbb92a61f08b50cae5c14d0030b81ee6ec

Author: Michael Bestas <mikeioannina@gmail.com>
Settings: Move home answer & power end call options

Move 'Home answers call' & 'Power ends call' options to button settings
Change-Id: I2f365a3d278b0845b7c5ffcfe70c54160a00c24e
bluetooth: Show a refresh icon on the select devices screen

The refresh menu is hidden behind an overflow which is
pointless. This patch shows the refresh icon if there is
enough room.

Change-Id: I35f19c42054b05388f7b8fcb82e0f3bd60e2d618
Display Settings: Better font size control

Use a SeekBar instead of a list/spinner to determine the font scaling.
For consistency, an approximate size (small, normal, etc.)
 and the exact percentage are displayed.
Show a preview of the selected font size immediately

Ported from CM 10.2, squashed commits 46678 and 49167.
Credit to Veeti Paaananen for the latter commit.

Change-Id: I754d7fdcaf27c23dfccf9d56291956e70b23f63e