Privacy Guard : Reimplement backed by AppOps

Re-implements privacy guard to use appops.

Change-Id: I2b52e8cf0d6e126fb156f83df885b5551503cd9d

Conflicts:

	core/java/android/provider/Settings.java
	core/res/res/values/cm_strings.xml
	core/res/res/values/symbols.xml

fix 1

fix 2

PrivacyGuard: add missing @hides to method definitions

Causing DroidDoc compile errors, this fixes it by adding
a @hide to the respective function definitions.

Change-Id: I27675cd6a75fcc1535c812566e5b9098b11335e1

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: 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 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

[2/2] Framework AppOps: Add per Op allowed and ignored counters

Port from cm-10.2

Change-Id: Ifb3d25e17dbab082b816a0a655b4796a83af336b

Hide additional AppOps function

Change-Id: Ife06bea56a2907acc9a7ab024e9b9aa30835652f

app ops: New ops, features, and modes

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

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

wifi: Confirm user permission before toggling wifi.

Check user permissions before enabling/disabling wifi.

Change-Id: I1ddae6e47f42b6d3fc831c2c135ece75cf9e935d

AppOps: Add Bluetooth enable control into AppOps

Check user permission before enabling bluetooth.

Change-Id: I9af341157df05104d3c5a52874538eefdbe14c4b

AppOps: Add data connect control into AppOps

Check user permission before enabling/disabling mobile data.

Change-Id: I6e1895b130788dfccbc0a8523dadf1559b698988

AppOps: Fix mms control in AppOps.

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

CRs-Fixed: 549192
Change-Id: Ia5b73e6b6a2c48b608a0ef1d199429c6c0e21f75

AppOpsManager: set default mode for sms write operation to MODE_ALLOWED.

The default mode for sms write operation is set to
MODE_IGNORED, so this was not allowing Bluetooth Map application
to do any write operation of SMS. So set the default mode to
MODE_ALLOWED.

Change-Id: I9fe7144d73a3b8bff99d4ab1c663b69007c32b66
CRs-fixed: 556330

AppOps: Add null pointer check for USERAGENT parameter.

Fix the Java exception which is caused by null pointer issue in
AndroidHttpClient.

Change-Id: If7e36298f94ca164b87e1b0604f49156bdfd4513

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 Chinese support for AppOps dialog.

Add Chinese string for AppOps Permission dialog.

Change-Id: I8d17262ea7ae564c7927be32e91742e1e5f93ce1

AppOps: Always remember user choice in ASK mode.

Remove 'always ask' option from AppOps. Remember user choice for
all operations.

Change-Id: If16a96eb95437ce54ee8d27b84ac6c284a110147

AppOps: Add Ops check for audio recording by AudioRecord API

Confirm user permission before audio recording by AudioRecord API

Change-Id: Ib534a2872d0743a8124b403a2f20465ceb467f64

Conflicts:

	core/res/res/values/strings.xml
	core/res/res/values/symbols.xml
	services/java/com/android/server/AppOpsService.java

appops: Fix WIFI_SCAN AppOp permission index

WIFI_SCAN and POST_NOTIFICATION permissions are inverted.

Change-Id: I97ebba0e118604294eb474143c53f7e7238dcb59
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>

fix