Recover apps with malformed certificates.

There was a window of time in Lollipop where we persisted certificates
after they had passed through a decode/encode cycle.  The well-written
OpenSSL library was liberal when decoding (allowing slightly malformed
certs to be parsed), but then strict when encoding, giving us
different bytes for effectively the same certificate.

A related libcore change (0c990ab4a90b8a5492a67b2b728ac9a4a1ccfa1b)
now returns the original bytes verbatim, fixing both pre-Lollipop
installs and installs after that change.

This change recovers any apps that had been installed during the
window of time described above by doing a one-time check to see if
the certs are effectively equal.

Bug: 18228011
Change-Id: Ib82bd6db718d0490d7a26c9c1014b7c8457a7f2d
Import translations. DO NOT MERGE

Bug: 18218486
Change-Id: I929129a2c443e4db78e0ad4e78e653a7cd603855
Auto-generated-cl: translation import
Increases the falsing threshold when for the keyguard affordances

The minimum amount has been increased by 20dp and in addition the
Motion is cancelled whenever a POINTER_DOWN occurs, which should
help a lot with falsing.

Bug: 18298401
Change-Id: I04b1f30fd2555c08209224f4e84c610ecd7a33f1
(cherry picked from commit 1dc406505cdcbbf98ece4f15a2f98f621e24abdb)
Add configuration to control converting sms destination number

Romove hard codes about the SimcardOperatorList and NetworkOperatorList.

Bug: 18081228
Change-Id: I0d96972c6097325634413137bfbdb5a246885276
Setting ADB_ENABLED may result in a SecurityException.

If the restriction UserManager.DISALLOW_DEBUGGING_FEATURES is enforced,
then any attempt to set ADB_ENABLED will result in a SecurityException.
This can result in the device not being able to boot.
Bug: 18433477

Change-Id: I21e4b406ad0fa89b7d4b678eac1baf212a3c7acd
Fix null handling in proxies.

ProxyInfo.getPacFileUrl() can not be null.  It will be equal to
Uri.EMPTY.  Checking for null was causing global proxies to never be
disabled.  Or more accurately, global proxies would be disabled, but
would reappear after a reboot.

ProxyInfo.getExclusionListByString() can be null.  If no
exclusion list was specified, the proxy settings would not be
successfully saved, they would disappear after reboot.

Bug: 18453223
Change-Id: I1c27e5dca5b9664bb7468ea909bff489fa110a07
Start MountService before performBootDexOpt

This change is to start Mountservice before starting
performBootDexOpt, as in one case, in performBootDexOpt
when system upgrade happens, StorageManager will be started to
get the low threshold of DataDir. But, at this point, as
Mountservice is still not up, StorageManager will end up
having a null object of Mountservice.

Change-Id: If2b5e1b58e7d2a72c6313f196e98a68738295ec6
Be increasingly aggressive about fstrim if it isn't being run

The current heuristics depend on devices being alive at midnight+ in
order to run periodic background fstrim operations.  This unfortunately
means that people who routinely turn their devices off overnight wind
up with their devices *never* running fstrim, and this causes major
performance and disk-life problems.

We now backstop this very-friendly schedule with an increasingly
aggressive one.  If the device goes a defined time without a background
fstrim, we then force the fstrim at the next reboot.  Once the
device hits the midnight+ idle fstrim request time, then we already
aggressively attempt to fstrim at the first available moment
thereafter, even if it's days/weeks later without a reboot.

'Available' here means charging + device idle.  If the device never
becomes idle then we can't do much without rendering an in-use device
inoperable for some number of minutes -- but we have no evidence of
devices ever failing to run fstrim due to this usage pattern.

A new Settings.Global element (type 'long', called
"fstrim_mandatory_interval") is the source of the backstop time.  If
this element is zero or negative, no mandatory boot-time fstrim will
ever be performed.  If the element is not supplied on a given device,
the default backstop is 3 days.

Adds a new string to display in the upgrading dialog when doing
the fstrim.  Note it is too late for this to be localized, but since
this operation can take a long time it is probably better to have
it show *something* even if not localized, rather than just sit there.

Bug 18486922

Change-Id: I5b265ca0a65570fb8931251aa1ac37b530635a2c
Properly recognize repeating wakeup alarms

cherry-pick from lmp-mr1-dev

The code in place was inappropriately treating all recurring alarms
as non-wakeup for purposes of deferral.  Worse, it was overriding the
"this deliverable batch of alarms includes a wakeup alarm" bookkeeping,
so could potentially cause inappropriate deferral of even standalone
wakeup alarms.

Bug 18591317

Change-Id: I2a62ed4badcaeb549c1ac4f086014aa829e45427
(cherry picked from commit 864d42eb96a9127b7d2f10ad11e709c24b4b4304)
Tune delivery and batching of alarms

cherry-pick from lmp-mr1-dev

* Inexact alarms no longer coalesce with exact alarms.  The motivation here
is that exact alarms are far more likely to be wall-clock aligned, and in
general pulling all alarms toward wall-clock alignment is a bad idea.

* Wakeup times are now fuzzed within the target batch's allowed window
rather than being hard pinned at the start of the window.

Bug 18631821

Change-Id: Iefaf34eee3f2a6546abefc27e177ee2fdcff935f
(cherry picked from commit 81f9882b5aadd6a2289c9f521a06a7af5f35ebf0)
Automatic translation import

Change-Id: I050ef51dac0254f88351fb1e3afcd07db92e0752
Fix Smart Pulldown

Currently if No dismissible or persistent is chosen, quick setting still appears when persistant notifications are present.  This fixes that.

Change-Id: Id8907a4f888e48ed511dd11b484508eca93fa0b3
Framworks: Possibly construct ticker views if user changed settings.

Otherwise it leads into a FC

Change-Id: I3f96e162fb9d221cca5d376f38c3a313c8746d48
Merge "Framworks: Possibly construct ticker views if user changed settings." into lp5.0
Merge "Automatic translation import" into lp5.0
Frameworks: add ability to change the color in battery saver mode (1/2)

User complain about the ugly orange....give the user the ability to change the
color in status and navigation bar if battery saver mode is activated.

Especially for you Tylog :D

PS
- move it into the observer...method is called to often to call every time
  the settings value for it.

Change-Id: I48ed2e85c462a2e94770b2bc1ad75b1ca40f2304
Merge "Frameworks: add ability to change the color in battery saver mode (1/2)" into lp5.0
Frameworks: Be sure heads up view is attached before removing it

We did not have it in our tests but some user ran into it. Thing is if the
system is disabling notifications for whatever reason and till this time the
view was never attached and the system tries to detach the view on windowmanager
we run into an illegal argument exception.

Fix it with simply checking if the view was attached before removing it.

Change-Id: I0800beed3553815cc529087052138345773b32e4
Merge "Frameworks: Be sure heads up view is attached before removing it" into lp5.0
Add support for QC's time_daemon

Enabled by BOARD_USES_QC_TIME_SERVICES=true, it requires the device
to provide its own time_daemon executable and libtime_genoff.so
proprietaries. The library should be copied by the device's setup
config to $OUT/obj/lib for linkage (and pushed to the final build,
obviously)

Change-Id: Ie6964dbe2692dc33fc04093a5b89b6922d8443c8