PIE: Improve assistant handling

Run it from SearchPanelView and determinate before, at PieMenu creation,
if we have any assistant available or not.

Some cleanup too.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Change-Id: I986a5e5257f432acd58dd2d75fc13f2b772c7453
PIE: Fix assistant issues

We should check if we have a search assistant any time pie is drawed, not
just on init. Also restore previous intent null check way instead of calling
SearchPanelView (may not be initialized yet at boot when pie and immersive are on).
Fix also an old bug, once activated for first time, on first google now swipe up
nothing happened (the check done at first init returned false).

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Pie: Fix navigation icon hints being cleared on reorientation

There is no reason to recreate the PieControlPanel instance if it already exists.

Change-Id: Id7bb4946a8fbd4595e840c605b90b97cab7b38ca
Revert "Pie: Fix navigation icon hints being cleared on reorientation"

Not recreating every time causes a regression of the hold pie while rotating bug

This reverts commit 148de1e8b7756a01e0d7f3353756fcb49860ba62.

Change-Id: I8dd2b22f257e66586fda018f7a90cfbcc982ba03
PIE: Add themeable colors support

Move colors to xml resources.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Pie: Fix Pie positioning when PIE_ALWAYS_AT_RIGHT

Locking Pie to a single physical side of the screen makes perfect
sense when it's done on the short side of the screen (bottom in
portrait) as then Pie is more easily swipeable in at all times, but
a user might instead prefer being able to quickly swipe in from the
right or left hand side in portrait which becomes cumbersome when the
device is turned to landscape as the user is then forced to reach to
the middle of the long side of the screen which becomes located at
the bottom making it harder to access Pie.

The PIE_ALWAYS_AT_RIGHT value should be used to solve this issue
by forcing Pie to relocate itself to the right hand side just
like with the stock navigation bar.

Change-Id: I9b4dd3cee3fa7d85194389640dcedc02fa522530
Pie: Fix repositioning issue for no h/w rotation

Since release, a bug has been lurking. It can be easily triggered by
placing Pie on the shorter bottom bezel and rotating to landscape in
any app. Then the user has to keep the device on a stable surface to
avoid triggering the hardware sensor and must simply use the Home
button on the Pie menu. After this, Pie trigger area will be placed
on the right-hand side, but will still appear at the bottom. When the
user moves/picks up the phone, the sensor will be triggered and Pie
will be correctly repositioned.

This commit also adds listening to screen configuration changes
directly along with using the legacy hardware sensors.

Change-Id: I7769b58fa36bd55bb6d4c44a28051916bfb1bbda
SystemUI: Display Pie in forced immersive mode

When an app developer decides that it is needed, immersive mode can be
turned on by the app. Prior to this commit, the stock navigation bar
was always shown when it was done. This commit creates a special
immersive mode (forced immersive mode) which is enabled when an app
requests immersive mode (status bar and navigation bar can be hidden)
if the user has chosen to use Pie prior to this. This mode then makes
Pie appear instead of the stock navigation bar.

It should be noted that this also introduces a minor issue when the
user turns off the standard immersive mode as when doing so, the new
forced immersive state is enabled until the QS panel is closed/swiped
up, after which the system automatically switches over to the fully
disabled state. This is caused by the QS panel still appearing to be
immersive to the system. It can be seen on the other side of the QS
tile as it will say "Forced" for the new special immersive state and
"Disabled" for the fully disabled immersive state.

Change-Id: I7beaaa5771f97de187c506cfa2547c52f084b51f