[1/2] Base: recover last location state during on/off switch

Based on this SlimRoms commit:
https://gerrit.slimroms.net/#/c/1421

Settings: https://gerrit.omnirom.org/#/c/4875/

Change-Id: Ia2484c9266d0276fd2d8bd0dc160487422e6063d
Lockscreen: See through (1/2)

Add the ability to see through lockscreen.
Adapted to kitkat from jellybean by @BigBrother1984

Signed-off-by: D4rKn3sSyS <jesdga95@gmail.com>
Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

PS2:

* Adding missing sem-colon.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Change-Id: I9057a6e302a5a824799844f27e8f64ff677a520a

PS3:

* Replace and remove undefined mContext.
* Define the boolean enableScreenRotation inside new method.
* Whitespaces clean up.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

PS4:

* Restore mContext in setKeyguardParams().

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

PS5:

* Fixes for setKeyguardParams() and maybeCreateKeyguardLocked() methods, kitkat changed some things.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

PS6:

* Missing sem-colon.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

PS7: Fix all the things.

* Effects doesn't vanish after first unlock.
* Created condition in updateShowWallpaper() method that just return if see through is activated, he was restoring the wallpaper at second lock.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

PS8: Cosmetic changes.

* Correct java style name to seeThrough() and place it above updateShowWallpaper().

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

PS9: Other cosmetic changes.

* Better name to the see through boolean.
* Removed a space nitpick.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

PS10:

* We had two booleans for the same thing, ditch the one defined in one class only and take the global.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Change-Id: I06d952f85baf284961a24c8c9f90b29f4aef719a

Conflicts:

	core/java/android/provider/Settings.java
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
	services/java/com/android/server/wm/WindowAnimator.java
Fix: Ensure lockscreen see through setting persists after reboot

If see through was enabled and the device was rebooted,
the user had to toggle the setting off and on again to activate.

Change-Id: I726220a39ac61cf135e5c63a9dbb8def7ed6fa2e
Fix: Correct possible null pointer when enabling see through lockscreen

PS2: Remove unused variable

Change-Id: I28884cb18964b273539261b8c0f72cedf2e60666

Conflicts:

	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
Frameworks: Lockscreen Blur

  If user selects "See through" under screen security,
  the locksceen background will now appear transparent
  with the content behind it blurred.

Modificaitons made to the orginal commit to support Hammerhead and Flo.
It seems full HD images causes rendering artifacts. To prevent this,
we scale the image size to something more manageable.

PS2: Reduce calls to System.Settngs
     Move bitmap scaling to DisplayPowerController
PS3: Fix styling
PS4: Fixes: 1. Black wallpaper after turning off see through
            2. Wallpaper flicker on unlock when blur is enabled
PS5: Ignore status bar and nav bar when capturing screenshots
PS6: 1. Remove content observer and unnecessary calls from viewManager
     2. Restructure the flow of setting the custom image
         * now closely follows setting album art as lockscreen image

Change-Id: Ie72bab697726af5e145bd0192980885ea7222ecd
Fix: Lockscreen Blur Rotation

Credits to David L.-W (David96)
https://github.com/AOSPAL/android_frameworks_base/commit/f80b748

Modifications made to address the issues noted in original commit

Change-Id: I721e7f8554433b903209da5587ac1dfcd83420cd
[1/3] Base: Increasing ringtone volume

Change-Id: I36df10d56612f67c5d44efd9c4e31532de06d901
[2/2] frameworks_base : custom clock shortcut in notification drawer.

Change-Id: I941cdebde0b9d90c92f83df9e44f40bb4d4cce63
[2/2] Framework AppOps: Forward port ops from cm-10.2

    Squash of:

    Author: Sam Mortimer <sam@mortimer.me.uk>
    Date:   Fri Sep 27 21:30:34 2013 -0700
    [2/2] AppOps: Add alarm wakeup op
    When alarm wakeups are denied/ignored,
    the alarm types are remapped as follows:
    RTC_WAKEUP -> RTC
    ELAPSED_REALTIME_WAKEUP -> ELAPSED_REALTIME
    Change-Id: I3a5023e1f6260004319290e776bdb2daf73e9fdf

    Author: Kun Liang <kunliang@codeaurora.org>
    Date:   Fri Aug 30 23:56:59 2013 -0700
    AppOps: Add data connect control into AppOps
    Check user permission before enabling/disabling mobile data.
    Change-Id: I6e1895b130788dfccbc0a8523dadf1559b698988

    Author: Shashank Mittal <mittals@codeaurora.org>
    Date:   Thu Sep 5 17:24:44 2013 -0700
    AppOps: Add Bluetooth enable control into AppOps
    Check user permission before enabling bluetooth.
    Change-Id: Iefa4ea3319b33b2639beaf38d261d83649bbcf85

    Author: Shashank Mittal <mittals@codeaurora.org>
    Date:   Tue Sep 3 19:23:10 2013 -0700
    wifi: Confirm user permission before toggling wifi.
    Check user permissions before enabling/disabling wifi.
    Change-Id: I1ddae6e47f42b6d3fc831c2c135ece75cf9e935d

    Author: Qaweck <qaweck@gmail.com>
    Date:   Dec 6, 2013 06:21
    Fix bluetooth and data enable with ProfileManager
    Handle the case of system uid in AppOpsManager
    Change-Id: I5f9c3ba2e2ed0b1c825b995bf2724066ae796bb4

Change-Id: I1d403d4325f105cd91f815f790cb01dd9b9f5516
[2/2] Framework AppOps: Add per Op allowed and ignored counters

Port from cm-10.2

Change-Id: Ifb3d25e17dbab082b816a0a655b4796a83af336b
[2/2] Framework AppOps: Add BOOT_COMPLETED operation.

Add BOOT_COMPLETED operation in AppOps.

This operation is used to allow user to control auto start of
applications and services at bootup.

Change-Id: Ie8488ec1b4683c8617ca569cfc858709f0d35ba2
AppOps: track op persistence by name instead of id

On XML write, include the op name.  On XML read, map
the name back to op id (if it exists).

Persistent AppOp state now follows the op name instead
numeric id.  This allows upgrades between versions of
android that have different code<>name mappings.

Change-Id: Iffc02095b6838a34ff999f8db51c2c6739dd0db8
[2/2] Framework AppOps: MODE_ASK and xml whitelist

  Squash of:

  Author: Shashank Mittal <mittals@codeaurora.org>
  AppOpsService: Add MODE_ASK support to AppOps.
  Add support for new mode(MODE_ASK) in AppOpsService to show a permission
  dialog box to user to confirm user permission before allowing or ignoring
  that operation.
  All strict operations (defined in AppOpsManager) are going to be in
  MODE_ASK by default.
  Operations will be moved to MODE_ALLOWED or MODE_IGNORED according to
  user's choice.
  Change-Id: I1314125a2b8be558e422e4a9eea0ff066c21bf94

  Author: Kun Liang <kunliang@codeaurora.org>
  AppOps: Add support for whitelist of packages.
  By default AppOps gives MODE_ASK permission to all strict operations.
  This can degrade user experience for pre-installed apps.
  This change adds support for passing a whitelist XML file to AppOps.
  Operations requested by packages listed in whitelist file will be set
  to MODE_ALLOWED by default.
  User can still go into settings and override permissions of these
  operations.
  Whitelist XML file should have following format:
  Example: whitelist_appops.xml
  <whitelist-pkgs>
    <pkg name="com.android.settings"/>
    <pkg name="com.android.systemui"/>
    .
    .
    .
  </whitelist-pkgs>
  Change-Id: I78bf5e7baa95f0e86f9856fb38bf1ca238691303

Change-Id: Iff8cdfbc0987aa9e422df37a083f05f0f1693dc8
Frameworks AppOps: Enable MODE_IGNORED for OP_WAKE_LOCK

  *) Kitkat commit log highlights that the current
     implementation state is for auditing only
     https://android.googlesource.com/platform/frameworks/base/+/713df150b92a0a5eea877f99405e31eefbf93a09

  *) We go one step further and honour MODE_IGNORED
     when for OP_WAKE_LOCK.

Change-Id: I889227ca24a508a0d96bd43594c5179ba758ae3d
[3/3] core: Add Dialer suggestions

Change-Id: I01b27afb075e36d8d807d2fdbf5032ddb6e10641
[1/3] Base: Add MobileNetwork Flip Tile

base from

https://gerrit.paranoidandroid.co/457

with moarr changes to OmniRom

toggle Network Flip Tile

for device support 4G (GSM)
toggle will change into 2G only => 3G only => 2G/3G auto => 2G/3G pref => 4G lte => back to 2G only

for device support 4G (CDMA)
toggle will change into cdma/evdo auto => cdma only => evdo only => 4G lte => back to cdma/evdo auto

for device unsupport 4G (GSM)
toggle will change into 2G only => 3G only => 2G/3G auto => 2G/3G pref => back to 2G only

for device unsupport 4G (CDMA)
toogle will change into cdma/evdo auto => cdma only => evdo only => back to cdma/evdo auto

4G toggle requires that at least one (1) of the following configs
must be present in the device's build.prop in order to use it:
telephony.lteOnCdmaDevice=1
telephony.lteOnGsmDevice=1

Conflicts:
	packages/SystemUI/res/values/custom_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsBasicNetworkTile.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java

Change-Id: I7183dddeab7b4bdd4562015dd3958f3b069039e4
Base: fix for notification count (multiuser)

 sometimes not appears if we enabled from config

Change-Id: I4d2782341a4076e1771379029699a04fedce499d
Base: fix statusbar brightness control gesture

Change-Id: Ic4001fb0fc6b7e1fe813d74104e42f7d91351d1a
input: Add workaround for broken hardware keyboard support

* Add workaround var for devices with broken kernels

Change-Id: Ib6ade70f399067469ba5aece48c6ec4608125d75
input: Fix workaround for broken hardware keyboard support

Using a wrong reference to mHardKeyboardAvailable caused device config
to never report physical keyboards.

Change-Id: I9b64e2d89512436c17fa8929464e2b727fba1cf3