Customisable location tile(2/2)

Change-Id: Id7a8a9522e8222ac990ebc13ae4b227c153d5ed1
quiethours: fix vibration logic

While QuietHours have different modes for haptic feedback and vibration, indeed
both uses the underlying VibratorService. This change adds some basic logic to
detect what quiethours mode should be applied to block access to vibrate calls
during quiethours.

This patch assumes:

1.- Single pattern vibrate calls are treated as haptic feedback if milliseconds
vibration is lower than 70 milliseconds
2.- Multiple pattern vibrate calls are treated as haptic feedback if the total
duration of the pattern is lower than 70 milliseconds and they doesn't need to
be repeated.

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

Change-Id: I0d090ca1189a5d132bf6a835e9921cf41e02d1fb
base: display live wallpaper settings instead of wallpaper picker

If the livewallpaper service declares and supports a settings activity, display it
instead of the wallparper picker in runnings apps details settings activity
(settings button)

Change-Id: I8db800cec4151ee5e6edddcea7a1bb5fb0528816
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
NetworkController: Extra WIMAX icon handling

- Fixes the dependency on 3g (or other mobile data)
  being connected for the wimax (4G) icon to show.
- Prevents the lack of mobile data (3g, 1x, etc) from
  removing the wimax icon if wimax is connected.
- Continue to show the network carrier type if
  phone is out of service but wimax is still connected.

Authored by: Matt Merhar

Change-Id: Ib1cf411cf4e7248248e093b6a7317fbe5d80f704
AudioService: Reduce volume to safe level when headset is connected (2/2)

This is a safety feature for users who opt to raise volume above the designated
safe level while using a headset.

Currently when a user does this they are provided with no protection against
dangerously high volume levels until the next time the headset volume warning
is displayed.

This patch adds an optional feature to ensure volume is no higher than the safe
level every time a headset is connected.

Change-Id: Idaa9cc9549bc3c6278e1e44490433c5366c29c16
Left handed navbar: fix keyboard placement in immersive mode

when using immersive mode with left handed navbar in landscape the keyboard doesn't account for
the navbar appearing from the left and leaves an empty layer on the right, we need to use mStableLeft
so it takes its position accordingly.

Change-Id: I937e46661673b8560357afd4cbd7289bae87734f
SystemUI: Rework SearchPanelView calculations

Make isScreenLarge calculations match how the system calculates where to put the navigation
bar. This fixes certain cases where the quick launch buttons on the glowpad of the
navigation bar is improperly oriented.

Patch set 2: The eval should be greater OR EQUAL to 600, not just greater. Also cache result
into a boolean before returning it.

Patch set 3-4: Actually cache it this time.

Patch set 5-6: Make it final.

Change-Id: I5703578b4d49a6eeab100bb23167abd5cf9a326d
SystemUI (MSIM): Add extra vaules for sim state ready

From: https://www.codeaurora.org/cgit/quic/la/platform/frameworks/base/commit/packages/SystemUI/src/com/android/systemui?h=LNX.LA.3.7.2.c5&id=8489b3de7da4efef624bacc6a1d5cf31bd922475

Change-Id: I14176d4cab14bc90198cefd3f4b4880b6d14f566
Themes: Force recompiling common resources when scanning theme

If a theme is re-installed multiple times and in less time than
the 3 minute timout for common resources, it is possible for the
installation to fail because it does not compile the common resources.
This is not something an average user would encounter normally but
theme designers that are working on there theme and constantly
installing updates have a better chance of encountering this situation.
We simply remove the theme from mAvailableCommonResources which will
allow them to be recompiled.

Change-Id: I04b64645157dbb1d0c26fab95c851b34bfff3f42
SystemUI: Fix data activity arrows for MSIM

PS5: Fix CAFs bad camel case

Change-Id: I77d4ce6d9707d621f417afadf0063a61777bb0bb
Automatic translation import

Change-Id: I7924f25b6405d5a5fa626eb2ba33ea8bd34190ff
Only start one WifiClientScanner

*) Fixes unexpected soft reboots.
E/AndroidRuntime(18586): *** FATAL EXCEPTION IN SYSTEM PROCESS: WifiClientScanner
E/AndroidRuntime(18586): java.lang.IllegalStateException: Cannot execute task: the task is already running.
E/AndroidRuntime(18586):     at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:576)
E/AndroidRuntime(18586):     at android.os.AsyncTask.execute(AsyncTask.java:535)
E/AndroidRuntime(18586):     at com.android.server.connectivity.Tethering$WifiClientScanner.handleMessage(Tethering.java:596)
E/AndroidRuntime(18586):     at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(18586):     at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(18586):     at android.os.HandlerThread.run(HandlerThread.java:61)

*) Remove unnecessary mDoScan class member variable.

Change-Id: I17ab368366b9a3456a625974c461783c428efec2
Revert "Avoid collision with RIL constant 1138, used in some Samsung devices for RIL_UNSOL_TETHERED_MODE_STATE_CHANGED."

Later Qualcomm RILs will use the STK_CC_ALPHA_NOTIFY message, and this
causes the radio to parse the parcel in a very incorrect manner.

This reverts commit 8e3fee66ff3a1d55f1aa69df7b52fdcab33f1f82.

Change-Id: I94e2867f130b88c4c9eff17293edd0b64dda516a
Fix wrong scaling of QS tiles

Also increase margin with the number of tiles shown
and tweak sizes for better usability

PS2: Whitespace fix

Change-Id: I78a1e0d41d487ac48edc5f8992b7d5c95fbbfa71
SystemUI : RemoteDisplayTile use executor

The registering/updating causes jank when done on main thread.

Change-Id: I3a07ddeeddf480641a8b1f55684983b24cd693d1
Update SET_ACTIVITY_WATCHER protection to signature|system

Change-Id: Iabf8ad2fc4b298e96b494917a140e0e4ea4e26e2
PackageManager: Add optional prelaunch check step

This ability is protected by config overlays.

Change-Id: I0c80bd9ec6bda3d21557aaa9503f05ff86adf434
Provide non-interactive APIs to BackupManagerService

- Add return codes for backup and restore in FullBackupRestoreObserver
- Add non-interactive backup and restore methods in BackupManagerService
- Add per-file filters for backup in BackupAgent

Change-Id: Ic1dfd5d144507263baad76f7088a52eab2fb283a
Add Secure.Settings.RECENTS_LONG_PRESS_ACTIVITY

This Secure.Setting specifies the activity component to handle
Intent.ACTION_RECENTS_LONG_PRESS.

Change-Id: I689e8b5c26b39e100cb166d2f93e7ee49e83f93a
Recents long press: add pluggable implementation

Adds a new intent ACTION_RECENTS_LONG_PRESS for the
long press of the recents button. Other system applications
can register for the intent to provide custom handling.
Handlers of this intent are queried for in the settings
application, and if no handlers are found, the default
implementation falls back on ActionUtils.switchToLastApp().

The long press listener on the recents button is replaced
with a touch handler to allow for more custom handling.

Change-Id: I8a27ae0fe58d92a1626f0bd661c5f57c589fac17