settings: Privacy Guard support

 * Add toggle to InstalledAppDetails to enable/disable privacy guard flag on
   a per-application basis.
 * Add toggle to enable privacy guard by default for applications.

Change-Id: If03aa5319c520b6c4a78887f0f46ef1443ddaa83

Conflicts:
	res/layout/installed_app_details.xml
	res/values/cm_strings.xml
	res/xml/security_settings_app_cyanogenmod.xml
	src/com/android/settings/SecuritySettings.java
	src/com/android/settings/applications/InstalledAppDetails.java

Conflicts:
	AndroidManifest.xml
	src/com/android/settings/applications/InstalledAppDetails.java
privacy guard: Fix crash when uninstalling an app

 * Don't try to update the privacy guard flag while refreshing after an
   uninstall since the PM will throw an exception at us.

Change-Id: Idadb99fefc2861e871f6206b08c844dda742fa68
Revert "Screen orientation is changed, the bluetooth searching is stopped."

This reverts commit 860b8a9a64bcdf71b24c3f2dfad70202d673e91d.
Handle cancellation of the 'enabling PrivacyGuard' alert box.

I noticed that the option could remain ticked but not actually enabled
if the alert box is cancelled.

Change-Id: If9a4e88641a5e4283d6ea16c17ca4461841580e3
Fix derp.

Change-Id: I2766f4c89460c967e32349be008e38b3600b7e76
Fix Setting->Display always force close issue

CTS's AdminTest will change the display timeout to 5 seconds.
It will cause Setting->Display 100% force close. It has been reported in
http://code.google.com/p/android/issues/detail?id=27026 . This patch is
for solving this issue.

Change-Id: Icf4061023f040ee164d161b9db717acbc9697124
Dont enable Wi-Fi if it's not toggleable in flight mode

Dont enable Wi-Fi if it's not toggleable in flight mode
by restoring the return which was removed by
e78c1879058571c00879f0d3e756951302adf513

Change-Id: I8ca5a3e9b3f36f148f08ce97b8a2b854bf7de21c
Lockscreen : Gesture Unlock

Change-Id: I154ccdd26f4607f4b6f4d0ad1fe795dc25bd630b
Stats: fix regex for jb-mr1 builds

Change-Id: Iff8175b4e229bbe0a7746a00f66d4484340e6064
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
Adjust aokpstats

Change-Id: I7f40da5313b0754862aab40db06555d752a719d8
Signed-off-by: Gergely Szell (sethyx) <szell@hu.ibm.com>
AOKPStats: update regex to reflect recent changes

Change-Id: I039bbf64487861cf0e8a820f3a64b5947a40564b
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
Add Google Analytics support

PS2: add custom dimensions and override app-name & app-version
PS3: report unified version name (branch + milestone-X|nightly|unofficial)
PS4-6: further reporting changes
PS7: add back own stats reporting

Change-Id: Ieb69944ba0e67cbaddb0e94c1b87fc99510bdd36
Squashed Stats commits from CM

Remove the notification on boot. Users are thinking they need to opt out to get rid of the notification.
The setting to opt-out still exists in the Settings app.
If the user does not opt out within 'tFrame' time (1 day), the checkin service will now run; prior
to this, the checkin service would not run until the next reboot. That next reboot could occur within a
few minutes (startup crash, which then automatically checks in before the user has a chance to opt out)
or even the possibility of never. This is unpredictable and buggy.
Change the checkin frequency from 7 days to 1 day.

CMStats: fix up the logic and potential sync failures

Clean up CMStats code.

Besides the cleanup, make sure to wait a bit between retries if upload fails for whatever reason.

Change-Id: Ib83e35bab2dc3d643751f032f810569dc71cafcc
Settings: Introduce Privacy Guard Manager

Due that on the one hand a lot user are not familiar
with permissions and how to read them and on the
other user want to have a faster easy access to
setup privacy guard for several apps this small
manager assist the user to setup.

Privacy Guard Manager shows a list off all installed apps
Per default it shows only user apps which have critical
permissions privacy guard can protect.
The user can optional show in the list as well all system apps
or turn off the filter to show all apps undependent of the
permission the app has. To activate privacy guard for an
app a simple click on the entry activates it so that the user
can go fast trough the list. Longpress opens app detail page.
Initial help dialog tells the user how to use it.

Due the filter user who are unfimiliar with permissions can
fast see which apps are effected without deeper knowledge

cheers

SlimRoms

PatchSet3:
- go inline with AOSP style
- move PrivacyGuard by default into manager
- change behaviour off active icons

PatchSet4:
- change app icon size to 36dip

PatchSet5:
- string change

PatchSet6:
- add reset option to disable privacy guard for
  all shown apps in the list

PatchSet7:
- Cleaned up the intro dialog a bit.

PatchSet8+9:
- cleanup
- fix alignment of top checkbox

PatchSet10:
- fix permission filter

PatchSet11:
- improve icon loading

Change-Id: I6bc886393bf90f8daed92b66d5fee1ce9e1accd0

Conflicts:
	proguard.flags
	res/values/cm_strings.xml
	src/com/android/settings/SecuritySettings.java
Settings: privacy Guard enhance app logic

This commit changes the following

- do not show apps signed with the plaform certificate at all
  (like settings, systemUI, android system etc)
  IMO the user should trust the android signed apps to be save and this will
  prevent weird behaviours user can get when they activate it on this packages
  all other system apps (like calculator, browser) and all which are not signed with
  android key are not effected.

- to go inline with AOSP disable the checkbox in detail app screen
  for built in apps

cheers

SlimRoms

Change-Id: I12b5522f6e58047173778381fb7290bb1c71bab3

Conflicts:
	res/values/cm_strings.xml
Storage Settings: Allow user to trigger a volume rescan

This change allows to trigger a rescan of a volume with the next restrictions:

- Internal volumes if they are emulates
- Primary volumes
- Non-Removable volumes

Requires http://review.cyanogenmod.org/#/c/44585/

Change-Id: I42aebc9fc0d3530cf0a3efb4d2139b688707d43d
JIRA: CYAN-1391
Issue: https://jira.cyanogenmod.org/browse/CYAN-1391
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>

Conflicts:
	res/values/cm_strings.xml
Let accessibility feature instructions scroll.

Change-Id: Ie0a9eae16e8bf2ea6033a9e5e4e2c149ab4859cc
JIRA:CYAN-1531
QuietHours Toggle (2/2)

Required for longpress action.

Reflect change in Settings.

Signed-off-by: Bajee11 <bajee11@gmail.com>
Change-Id: I2082e12fb2ce9e4063d960df540259eb6822fbcd

Conflicts:
	AndroidManifest.xml
	src/com/android/settings/Settings.java

Conflicts:
	AndroidManifest.xml
Fix IllegalArgumentException in Privacy Guard Manager

On tablets such as manta a this occurs.  To reproduce go into PGM, press
the back button one time, then go back into PGM.

http://pastebin.com/N7XAybUB

Remove privacy guard fragment in onDestroyView

Change-Id: I61cebe273fa6fd514f18c86894acd176701148f6

Check if fragment transaction is empty before attempting to remove it

Change-Id: I08591c89559d33fee30ac2934fdbcc30637147da

PrivacyGuard fragment fix - change from empty check to isDestroyed check

Change-Id: I52fe44b7446cd16793df6ac9cdbe31e2ddd70210
Signed-off-by: Paul Beeler <sparksco@gmail.com>

PrivacyGuardManager: Reduce calls to getFragmentManager

Change-Id: I74f07a58b09cf0e9114d0c1c56e9a97d55ab0900
Settings: AutoSmsReply while in QuietHours

Differs from original:
    AutoSMS Service is started/killed
        as needed

Change-Id: I608d80155b1faf61f23544820106956fa023155a

Conflicts:
	AndroidManifest.xml