Remove 'Allow custom buttons' checkbox (1/2)

Let hardware buttons be rebound by default.

Change-Id: Ib4fcae7d93dc63d53490442d7ff44678583b0d9c
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: Iefa4ea3319b33b2639beaf38d261d83649bbcf85
AppOps: Add data connect control into AppOps

Check user permission before enabling/disabling mobile data.

Change-Id: I6e1895b130788dfccbc0a8523dadf1559b698988
GestureInput : Allow doubletap/longpress configuration

Allows devices to specify pending intents for double tap and
long press events.

Change-Id: I7e7cc2f9f96a01d8f6232e5cf0e19832fdfd5359
Merge "AppOpsService: Add MODE_ASK support to AppOps." into cm-10.2
Merge "AppOps: Add support for whitelist of packages." into cm-10.2
Merge "wifi: Confirm user permission before toggling wifi." into cm-10.2
Merge "AppOps: Add Bluetooth enable control into AppOps" into cm-10.2
Merge "AppOps: Add data connect control into AppOps" into cm-10.2
AppOps: Fix resetAllModes() in AppOpsService

  *) Array iteration with inline deletion was broken
     causing PrivacyGuard reset not to work properly.

  *) Kanged fixed code from Kitkat

Change-Id: If36d38f9199e6282fe52eabc32cd652d8aca86fe
[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
[2/2] AppOps: Add per Op allowed and ignored counters

Change-Id: Ifb3d25e17dbab082b816a0a655b4796a83af336b
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 means you can upgrade between
versions of CM and the op number does not matter.
Handy when merging with future android code drops
(CM AppOp ids might be used by Google).

Change-Id: Iffc02095b6838a34ff999f8db51c2c6739dd0db8
Merge "Remove 'Allow custom buttons' checkbox (1/2)" into cm-10.2
camera: Better fix for face detection score issue

 * Do this at the lower layer so that third-party apps don't have
   issus with the nonstandard score.

Change-Id: Ic012b092d2f47dbaab8cbfe2bd215b955800cc11
Shell user needs UPDATE_APP_OPS_STATS

 * CTS fail with "bmgr run"

Change-Id: Ic950cda4363f8f2a4edfcb330a4d5b506a6c3685
Avoid IndexOutOfBounds Exception in ActivityManager

Bypass the iteration to avoid the exception during
the execution of ensureActivityVisibleLocked() because
startSpecificActivityLocked() within for loop may delete
the elements from History stack.

Change-Id: Iad9bdc6521b25b12d4c67e6b89f375a99b17748b
CRs-Fixed: 535900