gps: fixed singleshot session that doesn't stop

When a single shot location is requested and a
location is returned, the location request is
not stopped and so it continues even when the
requestor has stopped listening. This can cause
gps tracking to continue in the backgroud and eat
up battery.

This is fixed by stoping the provider if there
are no more update record associated with it
when a location is returned.

Change-Id: Ie437732ff06231a46724843af30e21ca3a1694ab
wifi: Disable the network based on the Deauth reason code.

Network connection failure shall happen due to various reasons
(VIZ assoc_reject, max supplicant loop iterations, authentication
failure due to wrong password, etc). For the cases apart from the
reason being assoc_reject there is no point continuing still
enabling the current profile and hence disable the same.

Change-Id: I9a0022d100dcfb1e1d1a9540ec6439ad140c06d1
CRs-fixed: 626680
Base: On-The-Go mode [1/2]

On-The-Go turns on the camera of your phone and streams it to an overlay,
which is drawn over everything.
this makes you feel like your display is transparent, as you see the content
behind it.

its really useful when you are using your phone while walking, thats why
we called it "On-The-Go"

allows to change transparency of the overlay via the notification.

have fun!

Change-Id: I3efccb5fac41a946f6cb4992e9181422980ee5e4
Base: On-The-Go: Allow to toggle between front and back camera

Video Preview:
https://www.youtube.com/watch?v=MnPGn0zwpEw

In case you want to pick that feature, feel free to edit the
commit message to get rid of that ugly video ;)

Change-Id: Ia6422bf5bbd531240e62ee57de316a8e6f94546c
Base: On-The-Go: Several fixes

handle camera in surfacetexture
check if notification manager is null before canceling
restart timeout when changing the camera mode
convert settings observer to a local variable
remove redundant try-catch clauses

Change-Id: If637e30f69706dc8b3f1397fafacb24c7bbb5083
Base: On-The-Go: Overlay status- and navigation bar as well

Change-Id: I067981028340cdd53fe112cae9b7a4ddcb7532a8
Base: On-The-Go: Change the way of changing the camera mode

changing it on the fly is too buggy like i have done it.
sometimes things fail and we are getting stuck ;P

on mode change, save the value, create a notification and stop the service.
the notification allows to restart the service.

Change-Id: Ie02f01a4ab2f856cd58fe5fde8c49220bf7efd4b
Base: On-The-Go: Allow to restart service on the fly

add a toggle to the options dialog to allow the user to restart the service
on the fly, instead of stopping it and create a notification.

it maybe be buggy, depending on how quick their camera can release and
recreate the instance, thats why i went the stop the service way by default

if the user chooses to recreate it on the fly, it resets the views,
triggers a handler with a delay of 1/2 second and sets up the views again

also increate timeout of the dialog, as the transparent dialog may be
harder to read for users and its annoying if the dialog disappears while
you search for the setting you want.

Change-Id: I1233854c10ee524925834c73ea20fba44c0f2a46
Base: On-The-Go: Add quicktile [1/2]

Also thanks to @Alex-Cruz for all these nice talks, which improved the
quality of the On-The-Go mode :)

PS 2:
On-The-Go drawables, made by Alex-Cruz, thanks!

Change-Id: I9413d4726428240aefd76ab06532b34dbfb04a2f
Base: On-The-Go: Switch Licenses to GPLv3

Change-Id: I3906fd0684b91e6e0535c5b9c5623fcf535e1eb3
Base: On-The-Go: Hide on devices without camera [1/2]

Hide camera switching for devices without front camera as well
if we dont have a front camera, open the first camera we have.
also hide the options from the dialog.

Change-Id: Ic74579708dc4ff030cca97f1f5972dce105431d8
Base: On-The-Go: Turn stop and start service if screen turns off and on

Change-Id: I46cbc6a59ab5489ab0fad2b6df355c60599f4cc0
On-The-Go: handle display orientation changes

Change-Id: Iad38e98a0c2a37be10c9b1e29fbf9f15b2a13852
On-The-Go: make it multiuser aware

Change-Id: Ib61cc35b196ead75dbd80b9b4bf2473df2ba444b