Check for null in LocalSocketImpl.SocketInputStream.available()

Calling available() on a local socket after close() will cause a native
crash. Other methods that pass LocalSocketImpl.fd to native code copy
the fd and check for null.

Change-Id: I2d0b573f34ae47a23009760bbb1c02933ab0a20e
Fix NullException in QwertyKeyListener.KeyDown

Extending null protection for view to "c == i" case in addition to
"c == Character.toUpperCase(i)" case that helped to fix some force closures.
Seems as typo in original implementation.

Change-Id: Ibaa5aea95c5c8cdc8ac981fe0d1dad313e3e692f
Signed-off-by: Dmitry Tsyganyuk <fdt017@motorola.com>
Release DrmManagerClient resources

Call release for DrmManagerClient to avoid resource leaks

Introduced by following commit (5d143ad4a8f...),
"Media scanner support for FL(Forward Lock) DRM file types"

https://android-review.googlesource.com/#/c/91081/

Change-Id: Ic3c458579f4e99b3b072a2e13362d1996b982589
aapt: i hate if (true) statements

Change-Id: If0d39f4d942067ae2d4ee4d32490b6e079a5f60d
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
Fix calculation of next DateChangedEvent time

Calendar.HOUR indicates the hour of the morning or afternoon. In the
morning this is no problem, but if this method is called after noon, it
will schedule the alarm for 12:00 the next day instead of 00:00.

Change-Id: Ibce239a6c7a41df85cf0c6ca3f45871a581eb7d9