appops: Fix an off-by-one error that causes the location icon to stay on

Commit bdfde4fc820fad768dbc596b17507e4cdc84b850 added Bluetooth AppOps
capabilities, but it contained a subtle bug where the string representation
was added in the wrong place, offseting every operation after it by 1. This
broke the toString functionality but didn't have any consequence since this
was used for logging purposes only.

Commit b01b08928a42a626f5f1c6c18a20d786fb873d75 changed AppOps so that
operations are persisted by name instead of by index, this caused the string
representation offset to affect functionality and, among other things, one
of the consequences was that coarse location requests were being interpreted
by AppOps as high-energy location requests.

Change-Id: I319f1ac1c5910098689b4cb8645eb92c0e3538cb
telephony: SignalStrengh: Don't calculate a LTE snr if the srq is invalid

If the previous values are invalid and signal quality is -1, chances are there's
no LTE signal at all, so don't calculate the SNR and mark it invalid as well.

This fixes the strength indicator in GSM devices where it was being skewed
by the ghost LTE value

Change-Id: I070573401c141aa99941a332ee256246697abb90
ProfileManager: fix coding style

Change-Id: Ia0c3dac6b73e2f22bae818f7ab992a9cfcadfa57
Fix getPrivacyGuardSettingForPackage()

Return true only if op mode is not allowed
and is not denied by a user restriction.

Change-Id: I8e58266ea8ed26726a634be523aeeba84adda30f
Frameworks: Redirect appops strings to string references

Based on strings in:

Author: Steve Kondik <shade@chemlab.org>
Date:   Tue Feb 25 13:11:12 2014 +0100
Relocate and cleanup new app ops features and PGify it
Change-Id: I4eb65f6f88c2f2aecdf054ffd52c31c4d5866900

Change-Id: Iba9a45838ee8eb7f5cb6ec6d29776574c86e84b6
[2/2] AppOps: Add alarm wakeup op

Port from cm-10.2 / cm-11.0

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: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
Date:   Thu May 22 19:54:01 2014 +0100
AppOps: Don't apply OP_ALARM_WAKEUP to system components
System can freely invoke and manage alarms. Preventing it from doing
so interferes with remote components like the backupmanager (backing up alarms)
due to the mismatched uids between the invoking app and the running
service that takes the action.
Change-Id: I079df8d2522642d6d9194781207df7dd67b715b2

Change-Id: I399a7f0d0b20c562b94ec978976d5d8ebff12eac
framework: fix screenshot and rotation animation for devices with abnormal hw rotation

port foreward from cm10.1:
https://github.com/CyanogenMod/android_frameworks_base/commit/ac555b9ca9a76d13a26fc9ea40980fe57258761b#diff-d6f7bba268a742c91252cc9e64e2381a

Change-Id: I14b6e2403b9be345a1a591138f8a3a12ca8e4f89
media: Scan FLV files, because why not?

Change-Id: Ia517d3057d843d7306f567cdbdddddd63c472a2b
SettingsProvider: Migrate STATS_COLLECTION to secure.

  Migrate STATS_COLLECTION to secure from system table while
  retaining the user preference. Moving it to secure allows us
  to do per-user settings.

Change-Id: Ia55fdd8c6db418c4eaebf17a54b765d25a878471
SystemUI: make long pressing recent switch to last app

With this patch, long pressing the recents key on the navigation bar
will attempt to switch to your last application in the activity stack
before the active one.

The user's current home launcher package is ignored as well as SystemUI (so that
RecentsActivity does not influence the behavior).

Change-Id: I38771e0fce16b55bb5186af47115b4e812cb60b0
Signed-off-by: Roman Birg <roman@cyngn.com>
Signed-off-by: Adnan Begovic <adnan@cyngn.com>
frameworks: allow last app action to be assigned to hardware keys

Also fix multi-user handling for 'switch to last app' and 'kill
foreground app' actions.

Change-Id: I1fb586d19b1198e6888b0f11e0a2813acf0bcd5b
Signed-off-by: Roman Birg <roman@cyngn.com>
Signed-off-by: Danny Baumann <dannybaumann@web.de>
Signed-off-by: Adnan Begovic <adnan@cyngn.com>
frameworks: add keyguard wallpaper functionality to WallpaperManager

Adapted for cm-12.

Change-Id: I0eb1b5578b705c2ade4c0772fa86e09478b9f73e
Signed-off-by: Roman Birg <roman@cyngn.com>
Merge branch 'cm-12.0' of https://github.com/CyanogenMod/android_frameworks_base into cm-12.0