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.

Conflicts:
	core/res/res/values/config.xml
	core/res/res/values/strings.xml

Change-Id: I8627a7c8e30861586e0e20d72fde25dd199c19b8
AppOps: Squashed commit of Appops enhancements

AppOps: Add support for AppOps policy file

Add support to read AppOps policy file.
AppOps policy file can be used to configure Ops default policy.

Change-Id: Idb4e3501ff9f58e491b06e74152342aa9574afbf

AppOps: Add Bluetooth enable control into AppOps

Check user permission before enabling bluetooth.

Conflicts:
	core/java/android/app/AppOpsManager.java
	core/res/res/values/config.xml

Change-Id: Ia9b626ce1ad90a2214a1c2f7374b4cbec1913017

AppOps: Fix mms control in AppOps.

Add support to check user permission before sending MMS.
Also seperate out SMS operations from MMS operations.

Conflicts:
	core/java/android/app/AppOpsManager.java

Change-Id: Ic608919e5a9f7f4d815140c8fa0acaa974dda72e

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: Add nfc enable control into AppOps.

Check user permission before enabling nfc.

Change-Id: Ia84e33c299e4fdecfd66ee933d9e7d37ed29c340

AppOps: change MODE_ASK to ALLOWED for receiving sms

SMS is received via broadcast. The operation checking doesn't
popup dialog to users because of broadcast ANR issue. So if the
mode is MODE_ASK and there is no popup dialog, then sms will be
ignored forever.

Meanwhile, receiving sms operation check is not the requirement
of appops. So one solution is to modify default mode for this
operation from MODE_ASK to ALLOWED and doesn't give user the
chance to modify it.

Change-Id: I2b6f90f13d3b2576bcbc6587ab2c6efa47c8dd52

AppOPs: add delete ops for some operations

Delete operation is required to be seprated from modify
operation. Add delete ops for sms, mms, contacts, and
call log.

Change-Id: I19ca4757884ba31a05b403a092796cc03042d31c

AppOps: Add data connect control into AppOps

Check user permission before enabling/disabling mobile data.

Conflicts:
	telephony/java/android/telephony/TelephonyManager.java

Change-Id: I04274494ade9d94d683ec3958bcb125010ff7d39

wifi: Confirm user permission before toggling wifi

Check user permissions before enabling/disabling wifi.

Conflicts:
	core/java/android/app/AppOpsManager.java
	core/res/res/values/config.xml

Change-Id: I2e48d8f7c694e88a73b28dd95ac0a60da58bc020

AppOps: Move labels from config to arrays

Change-Id: I34afc53f5c69eca3ebc0ae915df9882c330058ca
Reboot Recovery & Reboot Bootloader in Power Menu

Coded fram scratch by me (yashade2001). It's not a port from CM11 or other KK ROMs. Not hardcoded, used IPowerManager.

Drawables by MrBaNkS.

Change-Id: I9138a3b9b7ef5ba96806bf5e388f36a267530ca3
Fixes and additions to Yashar's patch
http://gerrit.dirtyunicorns.com/#/c/7323/

- Removed some images / replaced some
- Removed unnecessary code
- Made things work off an array (nicer)
- Added reboot option (Credit to DvTonder)
- Moved longpress to safemode to reboot
- Enabled airplane mode / Added replacement icons for it

Change-Id: I76238d5f2d0a1a4fd54dcb73e5761e5821129281
Make ImageView drawable update more efficient in some cases.

When updating the view's drawable via setImageResource or setImageURI,
make sure to skip the layout pass if the old and new drawable have equal
sizes. This follows what is already done for setDrawable().

Change-Id: If73d225e38d0a2f7c616c4aeb33f67bdaed390f1
Make "SD Card removed" notification dismissible if the removed SD Card is not the primary storage

The Galaxy S uses the "external SD Card" as the extended storage
and it the notification should be dismissible as it's okay not
to have it.

Additionally, this patch also not hide the USB storage mount dialog
if the removed storage is not the primary storage

Change-Id: Ic752a3da917e0d7736a619fb68f07905106987fb
Fix external sdcard mountpoint

It needs to add that line on init.xxxx.rc on rootdir folders.

"chown root root /mnt/media_rw"

Needed for devices that has some troubles mounting storages.

Credits: http://forum.xda-developers.com/showthread.php?t=2537793

Change-Id: I0c9e2ae5439c8d8a762904e2760eb6590ce77a62
SystemUI: Add missing recycle calls

Change-Id: I6e5346d9f423350e643d696299136799b78cdd28
Show live wallpapers in the recents view on high-end devices

Change-Id: Iefbf4f292b6a9bfdb516f154cc2976db2ba86cde
SettingsProvider: Update icon.

Change-Id: I9e1b540e0268643371dd95593eaefa63d4a1827d
Navigation bar custom height

Conflicts:
	core/java/android/provider/Settings.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Change-Id: I9ca00129929364bcbd7d6ea11b6d4220543303e4

Conflicts:
	packages/SystemUI/res/layout/navigation_bar.xml
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
status bar: native battery percentage

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
volume rocker: volume key cursor control
[1/2] SystemUI: Network speed indicator

Change-Id: I88e7cdfe20342c695a33383db36bf80bb4ffe009

Conflicts:

	core/java/android/provider/Settings.java
	packages/SystemUI/res/values/colors.xml
[1/2] SystemUI: Update network traffic indicator

Android measures the amount of data transferred in bytes,
however, by convention, data rates should be measured in bits
per second.

*Convert the change in total data and time to bits and seconds,
and then divide the amount transferred by the number of
seconds that have elapsed.

*Update the labels and have them use the correct SI prefixes.

*Factor out or add @hide to public methods and constructors

*Remove all Runnables and Messages from Handler queue when
disabled

*Minor formatting changes to stay consistent with Android's
code-style guidelines.
https://source.android.com/source/code-style.html

PS2: Set maximum digits to prevent it from filling the statusbar
PS3: Rebase
PS4: Add ability to display either bits or bytes

Change-Id: I9add610a8d14f5a48f2af0a82ced0c186224e282

Conflicts:

	core/java/android/provider/Settings.java

Conflicts:
	core/java/android/provider/Settings.java
[1/2] Base: Upgrade network traffic meter

*Updated class name to be less ambiguous
*Replaced the multi-check in settings with a proper listview
*Added the ability to view up-stream, down-stream or both
*Added the option to change how often it refreshes
*Added a check before it updates the status bar to prevent it from
refreshing everything needlessly
*Added icons to show data direction
*Remove unused style attributes

Icon artwork is courtesy android design downloads
Some features were inspired by previous work done by 0xD34D

OmniGears: https://gerrit.omnirom.org/#/c/5130/

Change-Id: I9f86292a6adbc5e30967df76fae510be248fc38b

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/res/values/colors.xml
	packages/SystemUI/res/values/mahdi_dimens.xml
	packages/SystemUI/res/values/styles.xml
	packages/SystemUI/src/com/android/systemui/quicksettings/NetworkSpeedTile.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarTransitions.java

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/res/values/colors.xml
	packages/SystemUI/res/values/simpleaosp_dimens.xml
	packages/SystemUI/res/values/styles.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarTransitions.java
[1/2] TrafficMeter: added option for auto-hiding on inactivity

Together with inactivity threshold

Thanks to @C3C0 for the code

Conflicts:
	core/java/android/provider/Settings.java

Conflicts:
	core/java/android/provider/Settings.java
TrafficMeter: fix auto hiding when Bytes is set as the unit
Netowork speed indicator layout fix
volume key adjust sound