This is new for 5.0
https://developer.android.com/reference/android/bluetooth/le/package-summary.html
The ScanFilter and ScanSettings looks interesting.
Android 4.3 introduced platform support for
Bluetooth Low Energy (
Bluetooth LE) in the central role. In Android 5.0, an Android device can now act as a Bluetooth LE
peripheral device. Apps can use this capability to make their presence known to nearby devices. For instance, you can build apps that allow a device to function as a pedometer or health monitor and communicate its data with another Bluetooth LE device.
The new
android.bluetooth.le APIs enable your apps to broadcast advertisements, scan for responses, and form connections with nearby Bluetooth LE devices. To use the new advertising and scanning features, add the
BLUETOOTH_ADMIN permission in your manifest. When users update or download your app from the Play Store, they are asked to grant the following permission to your app: "Bluetooth connection information: Allows the app to control Bluetooth, including broadcasting to or getting information about nearby Bluetooth devices."
To begin Bluetooth LE advertising so that other devices can discover your app, call
startAdvertising() and pass in an implementation of the
AdvertiseCallback class. The callback object receives a report of the success or failure of the advertising operation.
Android 5.0 introduces the
ScanFilter class so that your app can scan for only the specific types of devices it is interested in. To begin scanning for Bluetooth LE devices, call
startScan() and pass in a list of filters. In the method call, you must also provide an implementation of
ScanCallback to report when a Bluetooth LE advertisement is found.