AudioService: add STREAM_DTMF to stream affected by ringer mode

-STREAM_DTMF volume muted when phone in vibration or silence
 mode but will not restore when back to normal mode by setting
 STREAM_RING volume to 1
-Add STREAM_DTMF to the list of stream volume affected by ringer
 mode

Change-Id: Ib91d6b2c09e10b5cd86ae192cf334c69884da294
CRs-Fixed: 549908
Revert "Audio: Fixed system/call stream volume can't adjust with HS connected."

This reverts commit 570047be7b602a2935ced24f51c29d3f03f04ba6.
AudioService: fix cross deadlock in VolumeStreamState

Synchronize modifications of volume index by VolumeStreamState
class mutex instead of using synchronized methods.
This avoids possible cross deadlock when modifying volume on
two stream types simultaneously and one is slave to the other.

Bug: 13730145.

Change-Id: I13406c71010ce0c2e2f08f660b6101f310396c98
frameworks/base: Fix binder parcel leak with getMetadata() API

When VideoView calls getMetadata API of MediaPlayer, parcel object
is getting allocated by MediaPlayer and metadata is created over
parcel object. This metadata object is returned to the VideoView
which is being GC without calling recycle on parcel which was
creating leak in binder virtual memory.

CRs-fixed: 669303
Change-Id: I1e265909ee42d4fabd8b2552668b3d84af994294
IndexOutOfBoundsException observed in ProcessStats

Sometime, IndexOutOfBoundsException is observed in ProcessStats
while allocating longs array. This could be due to synchronization.
This fix will return if array index is >= size.

Change-Id: Icd81d84607ca28c5f1b0f9a05e255037252239fd
CRs-Fixed: 638977
framework/base: Do not kill the supplicant on a request to stop it

Supplicant is killed on obtaining the first TERMINATE event when
requested to stop from the framework. This shall result in improper
shutdown of the supplicant without proper cleanup of the resources
allocated for all the interfaces.
Moreover, there is no point in killing the supplicant when the
request itself is to to stop the same. Thus, do not kill the
supplicant on the TERMINATE event.

Change-Id: I954bb09faa94252eea53a14b090a6cff610c5964
CRs-Fixed: 601759
Tunning max allowed background services

The serialize running of background services feature
delay some services startup when system bootup, and
lead some abnormal behaivor at the early of system startup.
Tunning will be disabled after system complete bootup.

Change-Id: I834607d9156253bee13848586a8136e24760fdf4
Frameworks: Fix ap list issue while wifi turns on

Decrease the sleep time to resolve the synchronization issue
which happens between wpa_supplicant and Wifimonitor thread
when wifi turns on.

CRs-Fixed: 673012

Change-Id: I4e2414301ace26a26351b6c1345e1ff6e7ab49a9
wlan: Fix to handle the failure status on supplicant start.

WiFiController shall enter in to StaEnabledState state after the
request to start supplicant irrespective of status being success
or failure.Thus,any new attempts to turn on Wi-Fi later shall
fail as the controller statemachine is expected to be in
APStaDisabledState to start Wi-Fi.
Thus , start the supplicant on a command CMD_WIFI_TOGGLED in the
StaEnabledState if the current WiFi state is neither
WIFI_STATE_ENABLING nor WIFI_STATE_ENABLED.

Change-Id: If4c4913b608411bac334f9c201441aaf36d7675b
CRs-Fixed: 570305
DialogFragement: Add null pointer check for mDialog for protection

DialogFragement can be dissmissed just after the Dialog is
established. This will cause NullPointerException.

Add null pointer check for mDialog for protection

CRs-fixed: 549689

Change-Id: If57f81d03a8ec2906598363b681ea38806fb2a90