Bluetooth:GAP: Add NULL check before accessing accept socket

Add NULL check before accessing accept_rs variable to
avoid null pointer exception while referring to invalid
memory.

Change-Id: Ibc38d1c2fb19eb171cf136c47248ad8828676ac1
Fix bug where btpan_control_state_callback is called with invalid args.

When there's a connection error, btpan_control_state_callback sometimes
gets called back with incorrect local_role and remote_role values. These
values are simply not set (uninitialized) on one of the error handling
codepaths.

http://b/12854810

Change-Id: Ie2d9d252f185fca48ee6e2bfb697039d0ac10b43
Bluetooth: Adding Sniff feature for PAN Profile

Sniff feature for PAN profile was not implemented in power
manager module of the stack, which was causing higher power
consumption after connecting PAN profile, Even though PAN
ACL link is idle & there is no data communication between
DUT & remote device. Adding sniff feature for PANU role &
NAP role to reduce power consumption.

Change-Id: Idf568f53a317abd536edf34fbdf1733fdf53b7d0
Bluedroid: Fix UUID unsigned/signed comparison

UUID type was never detected as a 16 bits UUID due to a comparison
between signed and unsigned char in uuidType().

Change-Id: I6205ab4c2568f03b4692e0ce8a1dec216f1cdc0e
Signed-off-by: lpoulain <loic.poulain@intel.com>
Signed-off-by: Yong Yao <yong.yao@intel.com>
Bluedroid: Avoid multicast address for tun-tap interface

Linux Kernel disallows to set an ethernet multicast
address as ethernet device address.

The IEEE has specified that the most significant bit
of the most significant byte of a mac address is used
for multicast. If its a 1, that means multicast, 0
means unicast.

Bluedroid uses the BD address to set the tun-tap intf
mac address. This BD address can be randomly auto
generated, possibly with the multicast bit.

To avoid any address issue, this patch masks this bit
before setting the ethernet mac address.

Change-Id: Ifff4ec7237ae6cbef3b8d4c23096c5df65e1431c
Signed-off-by: Loic Poulain <loic.poulain@intel.com>
Reviewed-on: https://android.intel.com/184768
Reviewed-by: Zhang, Jianxun <jianxun.zhang@intel.com>
Tested-by: Zhang, Jianxun <jianxun.zhang@intel.com>
Bluetooth: Reset Disconnect Reason on Connection Establishment

This patch resets the disconnect reason to successful on HID Interrupt
channel establishment. Without this change, wrong reason is propogated
to BTA layer on disconnection initiated either from DUT or Remote end.

Change-Id: I42641b511e44a761574faf8eafb7b0826e24aeb3
Fix implicit declaration of function 'prctl' in bluedroid.

Change-Id: I288dd19bd478a3ff716d4f7f4179cc2b7574473a
Correct the OBEX OPP Profile version

Currently, the OPP Profile is registered using version 0x0100 (1.0), but
the initial version of this profile was 1.1. Since, there is no version
1.0, correct the version or this profile to 0x0101 (1.1).

Change-Id: I0befafb3656be5e33a8c9a0853207e53b46851a4
Signed-off-by: Robert Chiras <robert.chiras@intel.com>