Revert "MediaDrm#mNativeContext is a long, not int."

This reverts commit f0daefe2084db09c7bccc39ad6139ca753b3f409.

Change-Id: I9fd6593870548c9032a447853bd466f9250cd1fa
Keydispatching timeout while finish Activity

If there is input to be handled during finish activity we can get a
keydispatching timeout ANR. The reason is that finish activity is some
times not possible, and the activity is instead put on a finish queue.
The activity will then be finished sometime in the future. When we add
the activity to the finish queue, key dispatching is paused, and there
is an ANR timer waiting for it to be resumed again. Since it can take a
long time before the activity is actually finished, we need to resume
the key dispatching to avoid the ANR.

Change-Id: Icea4ab3b5ad05c8bfbadf8f5cece1a59ec621469
Clear the scan list when an empty list is received

When the framework receives an empty scan list from supplicant, it does
not clear the local list. So the UI will continue to show the previous
scan list even when there are no APs around. So clear the local list,
when an empty list is received.

CRs-Fixed: 552212
Change-Id: I8715bc31ce0df7bd54c96fcf7d7b73592429f12a
wlan: Error handling on PNO failure due to active P2P session.

If set PNO fails due to concurrent active p2p sessions,
handle the error condition in framework and issue a
regular scan for every framework background scan interval
until set PNO is either success or disabled.

Change-Id: Ia4e8d9aef9ed24e534cb57cea7c8ba7a7ffc509e
CRs-Fixed: 568458
Close sockets on wpa_supplicant termination.

Framework does not close the sockets on supplicant
termination, leading to leakage of file descriptors.

Thus close the socket on supplicant termination.

Change-Id: I50aefc6d60b3794288564f403a42258442e224df
CRs-Fixed: 576276
frameworks/base: add app launch timeline instrumentation

Displayed Activity is often being used to measure application
launch times. However Displayed Activity only accounts for a
subset of the app launch. This additional instrumentation will
allow for more accurate measurements of applications launch
times.

Change-Id: Ic0bc6f0110c3ecbbce9eccd9357818a8a898475e
wlan: Fix for delay in PNO scan trigger after p2p disconnect.

If PNO is disabled due to concurrent active p2p session,
on P2P disconnect PNO scan is not triggered until the next
framework scan is scheduled.
To mitigate this issue trigger the PNO scan on receiving
P2P_CONNECTION_CHANGED intent in disconnect state of the
wifi state machine.

Change-Id: I9de116f4c82ce103a5787f91b7c7129748fee517
CRs-Fixed: 584058