ProtectedApps: prevent NPE after app removal

Change-Id: Icf3ecfdf12ac92a8eb99787855cf067d03c46ed3
Deduplicate adapter-of-installed-packages code.

Change-Id: I454ba79eddaaff86233a2cc341f4c8bebe94729e
Remove SystemSettingSwitchPreference.

We should not introduce one-off UI patterns when there are plenty of
examples where the same usage pattern (a feature on its own
PreferenceScreen with a global enable switch in the action bar) is
handled differently everywhere else (e.g. daydream, cast display,
blacklist). This makes for inconsistent UX.
Also, there are discoverability issues: As there's no other case of a
preference with an embedded control widget opening another preference
screen, users won't expect to find another screen behind it.
Additionally - but entirely subjective - the control looks plain ugly,
as the preference padding is too large for the large switch.

Change-Id: I61284e961babefa3748102b05055fb1d03b079b0

Conflicts:

	res/xml/notification_drawer.xml
	src/com/android/settings/cyanogenmod/NotificationDrawer.java
Hide heads up settings and show a notice if heads up is disabled.

This follows a UI pattern used at several other places, such as
daydream, screencast, profiles or blacklist settings.

Change-Id: I5635338ceccae8ba8450284d3078889333fb77c6
Settings: Add heads up quicksettings tile. (2/2)

Change-Id: Ib1db69671d9f5c2c6dfa019739674fee50df9340

Conflicts:

	src/com/android/settings/quicksettings/QuickSettingsUtil.java
QuickSettingsUtil: kill redundant imports from cherryfail

Change-Id: Id4eed1d83c968b3b67b179ac8baebd1bbc7c59c3
Settings: Fix switch state being out of sync.

    - Since QS Tile can also set state of Heads up now,
    we have to set a content observer for the action bar
    switch.

Change-Id: I1c63fd2627a0f823eb6982456e1ed79ab84d1957
[WIP] HeadsUp: optional whitelist mode (2/2)

The frameworks half of this is happy without this for now.
TODO: make the "whitelist" (known as the blacklist) reload properly when you open headsup settings after checking the whitelist mode checkbox?
      or maybe just try take a look at this tomorrow and facepalm about whatever stupid problem is impeding functionality

Flips the per-app HeadsUp logic

Change-Id: Id9f830b488d9cfefe1851a4ed6bd939b7f136852
Automatic translation import

Change-Id: Icb77a2c1f07d2e54f64928f32f0b16482772fe47
Merge remote-tracking branch 'upstream/kk44' into kk44