Merge "IndexOutOfBoundsException observed in ProcessStats" into kitkat
Merge "Tunning max allowed background services" into kitkat
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
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
Bluetooth: Avoid fd leak for Bluetooth server socket connections

-As the close function of local socket implementation is dependent
 on mFdCreatedInternally, it will not be set for bluetooth server
 sockets, this will lead to fd leak on bluetooth socket connection.

-Exposed the API to set mFdCreatedExternally flag to close fd which
 was opened externally, so that when the actual close request comes
 fd will be closed successfully based on flag check.

CRs-Fixed: 638042
Change-Id: I22c6a973b30531407148f9d9e50820422d4427b0
Merge "Bluetooth: Avoid fd leak for Bluetooth server socket connections" into kitkat