Remove Application Widget from LockPatternUtils

The application widget option has been removed from Settings, and should
instead be handled by the application granted with the
SET_APPLICATION_WIDGET permission.

This change:
- removes the configuration value from the LockScreenSettings database; and
- removes the producers and consumers of the value.

Change-Id: Ia83e8d713d4455a9c898a8048a256afb7291af0b
SettingsProvider : Add ability to override default volumes

Change-Id: I5e1a5e5a7e872f9ead1700af0da09a3f2efd6e84
Installer: Use nanoTime instead of currentTimeMillis

It is possible for the Installer to timeout even though the elapsed
time of 100,000 ms has not elapsed.  This can happen if the system
clock changes while we are running something from the Installer.

The documentation says not to use currentTimeMillis for determining
timeouts and recommends using nanoTime() instead.

Change-Id: I376d5b0fad8eefcdeabbb7ed89ebd3d1d3c96ba0
Change permission guard on bindBackupAgent()

Bug: 15829193
Change-Id: I6c1c39923b7b1a9f528f97da10913cb7f2d7e8f9
Fix issue #16794553: Duplicate ArrayMap entries in Bundle...

...can lead to launching of un-exported activities

We now validate the array map after unparcelling to make sure there
are no duplicate keys.

And to make up for the performance overhead this introduces, I switched
the parcelling/unparcelling code to write keys as explicit string
objects rather than generic values.  There was no reason to use generic
values since the write method itself only accepts an array map with
String keys.

Change-Id: I57bda9eb79ceaaa9c1b94ad49d9e462b52102149
Do not persist and restore the media button event receiver

Do not persist the media button event receiver.
Do not restore the media button event receiver on behalf of the
  application that registered. Prevents reported vulnerability.

Bug 15428797

Change-Id: I7ca3e7fccb165c55b23f471c00e0ed77436f7dc1
lights: fix notification and attention lights

- Turn off attention light in pulse rather than
  just turning flashing off.  This was causing
  the LED to be left on for any HAL that obeys
  the concept of LIGHT_FLASH_NONE.  Most HALs
  will either treat this as OFF, or have special
  handling for the attention LED case where
  it was getting left on.
- Remove some unnecessary code in Light

Change-Id: I36292ae0d57e0454d7c9f1d3c909a87affeaf7d2
Pass all theme apks to themeservice for processing

3rd party apps expect ACTION_THEME_RESOURCES_CACHED once a theme is installed
regardless of the contents of the theme.

Previously only packages with overlays were passed to the themeservice
for resource processing. The result was packages without overlays would
install and ACTION_THEME_RESOURCES_CACHED would never be broadcasted.

Change-Id: I7cf3f8267805ef2a0626b2690b708e7bbae46bcc
MediaScanner : Add support for default ringtones per sim

Change-Id: I1ed112a38d2b3676e31a78eb70ea0e16a3957b02
ums: support UMS on any volume

Change-Id: I43668a5200d30cef953e0d3e9ded2d8cf0cbbd22
Vectone UK (MNC01) considered non-roaming on T-Mobile (MNC30)

Change-Id: Id74c854f958be721be12451a124cfd2f8b150255
Crop wallpaper and lockscreen images before saving them

Images were saved as-is and could cause large heap usage when
Wallpaper loads them later. This patch crop the images to fit the
screen size before saving them (as wallappper cropper activity does)

Change-Id: I08c04d9d14a65355c4417f0414d7a6ac538b3ea0
Disabling "Charging sounds" should prevent wireless sound as well

This is a fix for CYAN-4689 and also partial fix for CYAN-812. As noted in CYAN-812, separate section may not be a bad idea but the "Vibrate" checkbox already works with wireless charging so the sound settings should be allowed as well. There is no other (non complex) way for users to disable "wireless charging started" sound without modifying Android system.

Change-Id: I3311b94a7771863e49c1f83049600377dcf52d45
LockscreenInterface from ToggleLockscreenTile (Part 2 of 2)

The current longpress intent of the lockscreen tile is to open
the security settings activity. However, all lockscreen options
were moved to their own fragment months ago. This fixes the
tile longpress to open the current lockscreen options.

Change-Id: Ibca8403e69886d2c83f5240c4cae9adbb61535be
Automatic translation import

Change-Id: I82e4f38290b58a5cc4c84e8fd98e8e5483761bbe
BackupManagerService: Unbreak "adb restore"

The new restoreOneFile() logic aborts the loop whenever the result
isn't an actual successful restore. The problem is that a normal
backup will have plenty of non-restore cycles (APKs that are already
present being the most common), so this breaks regular "adb restore".

Go back to the original logic of completing the loop as long as the tar
file has data (or an explicit abort is generated)

Change-Id: I808cdc1c3b374e29d8438c7051e37c24a7a9d991
BackupMangerService: Pass result code in non-interactive calls

Non-interactive calls are made by Nextbit.  Continue to expose
detailed error codes for all failures.

Also:
- avoid overwriting the non-okay result codes; and
- re-enable version mismatches enforcement.

Change-Id: I54983d8f270285942db20eaff1e6de4229ec781e
Themes: Remove an app's icons from cache when installing

If an app is being updated then its icons will exist in cache. Go ahead
and delete them so that they can be recreated.

Change-Id: If0ee4388efd4aa146ebcdc46b1b0742f0852bad3
SettingsProvider: Animator settings are now in global

Load the animation defaults to global as well. That's where windowmanager
gets them from

Change-Id: I55f9231d05d4339b92cb6bd96d87bfe49e297fec
SystemUI: Allow showing data type with roaming indicator on MSIM.

  If a device sets a system property "ro.config.always_show_roaming"
  the roaming indicator will not replace the data type icon, but create
  a new indicator alongside signaling that the sim is roaming.

Change-Id: I60ac97572b9b50e4809dbd809a8e5a2d0763542e