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 remote-tracking branch 'cm/cm-10.2' into cm-10.2