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.

PatchSet: fix crash on uninstall
PatchSet: fix checkbox behaviour
PatchSet: Introduce Privacy Guard Manager
PatchSet: cleanup and comments
PatchSet: add permission filter to show only apps which have critical
	  permissions and privacy guard can hide the information.
	  by default filter is activated
PatchSet: small style correction
PatchSet: move note into an dialog help popup which is shown on first
	  start of PGM and after that available over help menu button

Change-Id: If03aa5319c520b6c4a78887f0f46ef1443ddaa83
Settings: ehance Privacy Guard Manager

move privacy by default option into manager
fit AOSP guidelines
add visual inidicator for Privacy Guard off

Change-Id: I50dd2b7ef48c7c949153dde9590a31417fcf0f23
Settings: PGM add reset option

Change-Id: I9b9396198775cb4e7dae90b40e2fddeeb4b0d187
Settings: fix checkbox privacyguard + cleanup

Fix padding issue as well big cleanup. Danny showed an
easyer way :D

finally finished

Change-Id: I4002a52c7d5ba6261482a7ba5ef32952e04f8f2e
Settings: PGM improve icon handling

Change-Id: Ic7e7dcc6bbc3837985f18a44588dba2cea47a9b7
Settings: privacy Guard ehance app logic

This commit changes the following

- do not show built in apps 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

- reflect as well show system apps to the detail app screen

cheers

SlimRoms

Change-Id: I12b5522f6e58047173778381fb7290bb1c71bab3
Settings: Fix up and optimize

Change-Id: I87e376dce590ee52661faedf6d510f68b51852ad
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
Sort disabled apps to the end of the list in privacy guard manager.

JIRA: CYAN-1707
Change-Id: Ie3c1cf0339d66405d27c06dba07cc80e4001d669
PrivacyGuard : Reimplement to use appops

Re-implement privacy guard to use appops

Change-Id: Id97b6ecf8d4c844d3496adc71eeaba7ea050ce1d
privacy guard: changes part 1

the new cm implementation from our privacy guard is not the best.
Some changes we needd to do next week. For first give back the ability
to filter critical apps + do not show apps without any permissions
to do
- enable only the critical permissions the app is using
- add another active icon to notify the user if he modiefied another permission then the default ones
- add ability to disable notifications

Change-Id: I38207cb2639a2dc7f56bdce4ba2b9c4d325efe4a
Settings: Privacy Guard part 2 (2/2)

Current implementation does not really merge both awesome features
appops and privacy guard. As well it is from UX perspective too complicated

So this commits changes:

- Move int array to logical correct place AppOpsManager
- Switch only the privacy guard permissions which the app
  really requests and not all...this irritates the user
- give support for custom permission set and reflect this state
  with an icon in notification and pgm
- add pack filterpermission feature due that user mainly are interested
  in the apps which use critical personal data
- permit by default as well writing off personal data
- do not show apps where either permissions are not changeable due
  off appops or apps which do not have permissions at all
- ability to hide pg notification
- remove pg checkbox in InstalledAppdetails and add a button to
  modify appops. Button is disabled if either the app does not have
  permissions or appops does not support it. As well for platform
  certificate apps
- add on appops detail screen reset and privacy guard button to quick
  change all states
- rework of the complete dialog handling in pgm and add several dialogs
- move all notify icon for pgm and notification to frameworks base
- and a lot more minor fixes and fc fixes

cheers

PatchSet:
- correct privacy guard filter logic
- add pgm map
- add status icons.....PGM shows either off/partly enabled/enabled
  in addition to it other set permissions shows a red plus sign on
  the top right corner of the PGM icon on all states
- tapping on PGM and menu pgm button on detail appops screen turns on/off
  only PGM permissions to be more consistent
- some minor fixes

PatchSet:
- remove permanent appops filter in pgm
- add hint on appops detail screen if no permission can be set

PatchSet:
- save listview state when calling another activity and going
  back

Change-Id: Iec35fc58e16ce2eb750b265d4187b5891a79d6e5