package Ġcom . be ep iz . bluetooth . sc anc or outines . experimental Ċ Ċ import Ġandroid . annotation . Target Api Ċ import Ġandroid . bluetooth . le . Bluetooth Le Scanner Ċ import Ġandroid . bluetooth . le . Scan Callback Ċ import Ġandroid . os . Build . VERSION _ CODES . O _ MR 1 Ċ Ċ internal Ġconst Ġval ĠSC AN NER _ ID _ SCAN NING _ TOO _ FREQ U ENT LY Ġ= Ġ- 2 Ċ Ċ @ Target Api ( O _ MR 1 ) Ċ internal Ġfun ĠBluetooth Le Scanner . get Scanner Id ( callback : ĠScan Callback ): ĠInt Ġ{ ĊĠĠĠ Ġval Ġscan Clients Field Ġ= ĠBluetooth Le Scanner :: class . java . getDeclared Field (" m Le Scan Clients "). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġis Accessible Ġ= Ġtrue ĊĠĠĠ Ġ} ĊĠĠĠ Ġ@ Suppress (" UN CHECK ED _ CAST ") ĊĠĠĠ Ġval Ġle Scan Clients Ġ= Ġscan Clients Field . get ( this ) Ġas ĠMap < Scan Callback , Ġ*> ĊĠĠĠ Ġval Ġble Scan Callback Wrapper Ġ= Ġle Scan Clients [ callback ] Ġ?: Ġreturn ĠSC AN NER _ ID _ SCAN NING _ TOO _ FREQ U ENT LY ĊĠĠĠ Ġval Ġscanner Id Field Ġ= Ġble Scan Callback Wrapper . java Class . getDeclared Field (" m Scanner Id "). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġis Accessible Ġ= Ġtrue ĊĠĠĠ Ġ} ĊĠĠĠ Ġreturn Ġscanner Id Field . getInt ( ble Scan Callback Wrapper ) Ċ } Ċ