FW: Active Display [1/2] + AppBar fixes

Squashed commit of the following:

Add active display

Ring Notifications as implemented on  the Motorola
Moto X.

credit to 0xD34D who i'm assuming wrote most/all of the code.
I found it unfinished/broken in his gerrit and simply fixed it,
improved & optimized a bit

PS2: remove unrelated NavigationBarView diff
PS3: optimizations

Change-Id: Iad6a62a98adc6cc698dc852f1a1477d3ca601e5d

Conflicts:
	core/java/android/provider/Settings.java
	core/res/res/values/dimens.xml
	packages/SystemUI/res/values/dimens.xml
	packages/SystemUI/res/values/styles.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java

ActiveDisplay: handle NameNotFound inside notification loop, and handle icon resource == 0

ps4: prevent NPE if dismissed called with null mNotification

Change-Id: I880ad698a8c6b203039d09bc95bfbd16ac9f789e
Signed-off-by: nuclearmistake <nuclearmistake@gmail.com>

refactor 0xD34D's changes to active display and add Vanir's

improvements still not sure where the original "porn display" came from as
it was called.. but thanks for porting mr scheff.  more to come.

ps3: FIX A FUCKING STACK OVERFLOW IN THE SETTINGSOBSERVER.
     -NUKE

Change-Id: Id1dfecf8d1488deb476ffa0f09c8137dcd492567

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java

updates to  active display:

commit da4016824b2e5cad3415cdf8b7b42e25ec39e5ae
Author: 0xD34D <clark@scheffsblend.com>
Date:   Thu Sep 19 19:57:55 2013 -0700

    Delay hiding systemui by 100ms
    When disabling the keyguard, the systemui visibility is
    changed and can occur after we hide it so delaying this
    a bit resolves that issue.

    Change-Id: Iad432f75195983837d643fa38495e6beb54f3e22

commit 4aff6f4e2a9a2d3bff33016ca745993054446311
Author: 0xD34D <clark@scheffsblend.com>
Date:   Thu Sep 19 13:55:41 2013 -0700

    Active display: Add sunlight mode. [1/2]

    Change-Id: I541e74c5a1a7e6ce5028ab00cf998bba1d4fe0f9

commit 9cd95cf25ffdf8627a54746a114e2399cccca02a
Author: PrimeDirective <activethrasher00@gmail.com>
Date:   Sun Sep 22 11:32:53 2013 -0400

    remove observers activate logic
    until i have more time to get this going.  probably
    easier anyways until the initial wave of development on
    this subsides

    Change-Id: Ib38c1dcf35d4a40f606e0a37208e7e26ffbf06a3

commit 45b911b27ac7b9f04852727b7c3bdc08528f1622
Author: PrimeDirective <activethrasher00@gmail.com>
Date:   Sun Sep 22 11:21:35 2013 -0400

    increase notification changer icon size

    Change-Id: Ia73f556b6bccfe6bd33f7af82ca079509b08f3a9

Change-Id: I4ef6cc5cc61e50caa9416d64551ddfcc60a14520

Conflicts:
	core/java/android/provider/Settings.java

activedisplay: flag_fullscreen for your viewing pleasure

Change-Id: I5deb5e3127f854c3e2773dc1b9ffb1336a985d65

Active-D: flag_layout_in_overscan is also needed

Change-Id: I08cb92ace6c1eb11f5af8447e1ba45e7ef4ef2c2

Revert "Active-D: flag_layout_in_overscan is also needed"

This reverts commit ddce9a3a995297c13290885a733a0507cf989545.

Change-Id: Ie0710a14e898032a1e95aff84f60aa54a532c8f1

active D: a few fixes

ps1: make sure receivers are only registered when the setting is active
ps2: combine make sure mNotification is set properly
ps3: make active D not shownotification if it's for an incoming call
ps4: cleanup

Change-Id: I69930a1495cb4fa5e7daa91dde951c097b15fb2f

Fix crash in systemui caused by disabling AD. *facepalm*

Change-Id: Ibf417b30dab18c70198dc72784c2f1d2021a04c4

active D icon resizing

fix layout issues on xhdpi devices for the drag handle
increase the size of the overflow notifications slightly
increase padding of overflow icons slightly

Change-Id: I2f6ab9840916f09045051913763904c003a812e5

Active-D: Eradicate sunlight mode (1/2)

Active notifications were designed for devices with a direct relationship between the # of pixels on, and power consumption.
... AND we can drastically reduce the incidence of sunburns among Vanir users by removing this.

Change-Id: I0853b1ff88ec1d1ba48de7589f11a7b4d3c4c412

Conflicts:
	core/java/android/provider/Settings.java

Active-D: Increase proximity sensor sampling delay from 60,000 microseconds to 200,000 microseconds (change rate from ~16.6 Hz to 5 Hz)

Change-Id: Id92dab800696b5fd0b9f21cfc3fa65225dad9734

Active-D: Unregister proximity sensor when screen turns on, and register when turns off

ps2: typo
ps3: whitespace

Change-Id: I2a66d2f2f8a21cde9c8a278ea985972a6e7c577e

Active-D: and girthy.

And add some debugging helpers and messages (disabled with final static bool ATM)
Flip on debugging temporarily
Prevent the proximity sensor from double-tapping when waking the device.
Reduce the threshold below which the phone is declared to be in a pocket.

Change-Id: I0c38bf33e0461a4b0b014f505e7d3db66f3af344

Active-D: save some B

Only enable the proximity sensor for long enough to get one reading at <1 Hz.

ps3: fix nomenclature error
ps5: don't actually register and unregister the listener... a change that happened while unregistered is not reliably reflected in the values in the callback.
ps90: Change handler the settingsobserver is instantiated with, and don't catch securityexceptions to allow systemui to be resurrected if the first notification-showing fails

Change-Id: I4627cb4ca27b07fac8f1606c02d886a3efa2af40

Active display: allow hiding low priority notifications. [1/2]

ps2: COPY/PASTA

Change-Id: I4831d6864b509e62b449c25619c59f5d6760ec47

Change-Id: Ia35cf32cbba54b7ef074df262364bb8107c5068d
Revert "Camera: Adds support for meta data callbacks"

This reverts commit 49235653e463440a49f3a746b86f1b429dbcb2fb.

Change-Id: I0503bf0b5c70fa37051a343af25f002201464c17
More Active Display stuff

Revert "FW: Active Display [1/2] + AppBar fixes"

This reverts commit dcb81acde1fe5733cf47fc4ab72b18f37e27de70.

Add active display from ChameleonOS…
…[1/2] [log]

Including additional commits:
- Correct active display settings naming
- Active display: Add options for date and am/pm [1/2]

This is the ChameleonOS implementation of the active
display feature, similar to that found on the Moto X.

When enabled the screen will turn on and display the
incoming notification.  The user can then open the app
for the notification, dismiss the notification or unlock
their device normally.

Additional notifications, if any exist, will be displayed
below the ring notification and can be viewed by touching
the notification icon.  The user can simply slide their
finger across these other notification to quickly view
them.  The last one touched will remain in the ring and
the user can then perform any of the actions listed above.

PS2-PS12:
All the changes that brought us to this current implementation.

Change-Id: I51c17cec33b65dc60111a10c5ca2c449596ebe63

Fix active display.
Change-Id: I7f287deeae4801c6491f69985b667ad3fa2c2d54

Delay hiding systemui by 100ms
When disabling the keyguard, the systemui visibility is
changed and can occur after we hide it so delaying this
a bit resolves that issue.

Change-Id: Iad432f75195983837d643fa38495e6beb54f3e22

Active display: turn off display if device gets pocketed again

Change-Id: Icb4c002add915b75de7607f71c0d400e323feb5b

Active display: prevent force close
[log]

Change-Id: I0f96a964fbc55419f86a3707d9d6929f872e5bd8

Active display: unregister proximity if pocket mode not used or active display disabled
[log]

Change-Id: I7c634e1ee48e82024faad53bb1bae8fe19da439d

More Active Display stuff

Revert "FW: Active Display [1/2] + AppBar fixes"

This reverts commit dcb81acde1fe5733cf47fc4ab72b18f37e27de70.

Add active display from ChameleonOS…
…[1/2] [log]

Including additional commits:
- Correct active display settings naming
- Active display: Add options for date and am/pm [1/2]

This is the ChameleonOS implementation of the active
display feature, similar to that found on the Moto X.

When enabled the screen will turn on and display the
incoming notification.  The user can then open the app
for the notification, dismiss the notification or unlock
their device normally.

Additional notifications, if any exist, will be displayed
below the ring notification and can be viewed by touching
the notification icon.  The user can simply slide their
finger across these other notification to quickly view
them.  The last one touched will remain in the ring and
the user can then perform any of the actions listed above.

PS2-PS12:
All the changes that brought us to this current implementation.

Fix active display.

Delay hiding systemui by 100ms
When disabling the keyguard, the systemui visibility is
changed and can occur after we hide it so delaying this
a bit resolves that issue.

Active display: turn off display if device gets pocketed again

Active display: prevent force close
[log]

Active display: unregister proximity if pocket mode not used or active display disabled
[log]

More Active display stuff

Revert "Active display: unregister proximity if pocket mode not used or active display disabled"

This reverts commit 8815f8f74e9950f06391355beac910872b4013f1.

Active display: make sure mNotificaiton is set correctly
Active Display: check if recievers and listeners are registered

Active display: Catch Resources.NotFoundException

This caused the SystemUI to FC when the device was powered and a notification was fired.
Display stayed off and the SystemUI kept restarting until the device was unlocked manually.

Active display: Ability to turn off the screen, when a not clearable notification is present
[log]

Active display: Unify (un)registering callbacks and add proper checks

Active display: Don't register proximity if pocket mode not used
[log]

Active display: Add threshold to proximity sensor…
… [log]

Display will only be activated if the proximity sensor is covered for 5 seconds or more.

Active display: Respect Quiet Hours
[log]

Active display: Fix for HDPI devices
[log]

Thank's to @AlmightyMegadeth00 for the tips...

Active display: Make GlowPadView center the current notification icon for us

sudo makemeasandwich

ps2: make scaling both smarter and stupider SIMULTANEOUSLY

Active display: allow hiding low priority notifications…
…[1/2] [log]

Active display: Catch NPE

Active display: Fix visible NavBar buttons on LockScreen

[log]

Active display: Next try to fix "turn off display if device gets pocketed again"

Revert "Active display: Make GlowPadView center the current notification icon for us"

This reverts commit 3100c626d43c0d2939af9c2dcab13ac1980c24ae.

Active display: Use a default notificaiton icon

In case there is an exception when trying to load the
notification icon we will use a default one.

Revert "Active display: Don't register proximity if pocket mode not used"

This reverts commit b65c58371fc7593a57efb0e2e009ba67b55348c9.

Active display: Enable proximity sensor only when screen is off

[log]

This should ease people worried about cpu usage of the proximity
sensor while the screen is on.  The sensor listener will only be
registered when the screen goes off, and both active display and
pocket mode are enabled.  Once the screen turns on this listener
will be unregistered so no further updates are received when the
sensor values change.

by Der_Schubi:
In our case we left the sensor activated til the screen gets
unlocked or notification is opened to be able to turn the screen
back off if the device gets pocketed again.

Fix some Derps

Revert "Active display: Fix visible NavBar buttons on LockScreen"

It doesn't work yet. Its only a bit better... :(

This reverts commit 01ec1b6eb4a000f61ea9d5c2321637f0b7e4ba82.

Active display: Fix visible NavBar buttons on Lockscreen

[log]

Active display: Add some log output

RAWR!

Change-Id: Ic14e78c7bf78d9533f5f6d2717cb90cf628325bf
FW: Fix Notification Shortcuts

All credits to SlimRoms for their awesome work on the Notifications shortcuts, this commit corrects the PAC code to the SlimRoms 4.3 implementation.

Unable to cherry-pick a commit to correct our code issues but the original commit retains authorship and all credits for this code are solely attributed to the SlimRoms team, I have only corrected the PAC code port of this feature.

Change-Id: I418dba621cd98745cb6804a2bdd2ba447e580daf
Merge pull request #1 from PAC-man/cm-10.2

Maj