Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

altbeacon does not detect beacon devices on Android 12 and later #1197

Open
G-Roman1988 opened this issue Jun 21, 2024 · 10 comments
Open

altbeacon does not detect beacon devices on Android 12 and later #1197

G-Roman1988 opened this issue Jun 21, 2024 · 10 comments

Comments

@G-Roman1988
Copy link

Hello! The Android beacon/altbeacon library (version 2.20.6) does not identify any beacon devices on Android 12 and above, but on Android 11 and below the same code works (it identifies). I am working on an application to help visually impaired people identify public transport and I am stuck with this problem. I have tried many solutions I found on the internet and in the documentation, but with no success. Steps to reproduce the problem: create a standard iBeacon and set a UUID for personal proximity, then try to scan beacon devices with the Android beacon/altbeacon library version 2.20.6 on Android 12+. In the log, it shows something about the scan job immediately and the periodic scan time. I will leave the code and manifest file below. Please, anyone who can help, any solution is welcome. package com.gtdvm.echopoint

import android.annotation.SuppressLint
import android.app.Activity
import android.bluetooth.BluetoothAdapter
import android.bluetooth.BluetoothDevice
import android.bluetooth.BluetoothGatt
import android.bluetooth.BluetoothGattCallback
import android.bluetooth.BluetoothManager
import android.bluetooth.le.ScanCallback
import android.bluetooth.BluetoothGattService
import android.bluetooth.BluetoothGattCharacteristic
import android.bluetooth.BluetoothGattCharacteristic.PERMISSION_READ
import android.bluetooth.BluetoothGattCharacteristic.PERMISSION_WRITE
import android.bluetooth.BluetoothGattCharacteristic.PROPERTY_WRITE
import android.bluetooth.BluetoothGattCharacteristic.PROPERTY_NOTIFY
import android.bluetooth.BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT
import android.bluetooth.BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE
import android.bluetooth.BluetoothGattDescriptor
import com.polidea.rxandroidble3.RxBleClient
import com.polidea.rxandroidble3.RxBleConnection
import com.polidea.rxandroidble3.RxBleDevice
import com.polidea.rxandroidble3.RxBleDeviceServices
import com.polidea.rxandroidble3.scan.ScanSettings
import com.polidea.rxandroidble3.scan.ScanFilter
import com.polidea.rxandroidble3.scan.ScanResult
import com.polidea.rxandroidble3.RxBleScanResult
import com.polidea.rxandroidble3.exceptions.BleException
import com.polidea.rxandroidble3.exceptions.BleDisconnectedException
import com.polidea.rxandroidble3.NotificationSetupMode
import com.polidea.rxandroidble3.RxBleConnection.RxBleConnectionState
import android.location.LocationManager
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.content.pm.PackageManager
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import android.content.Context
import android.content.ServiceConnection
import android.icu.number.IntegerWidth
import android.os.Build
import android.os.Looper
import android.os.ParcelUuid
import android.os.RemoteException
import android.provider.Settings
import android.util.Log
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.animation.defaultDecayAnimationSpec
import androidx.compose.ui.res.integerResource
import androidx.compose.ui.res.stringArrayResource
import androidx.lifecycle.ViewModelProvider
import io.reactivex.rxjava3.disposables.Disposable
import io.reactivex.rxjava3.core.Completable
import io.reactivex.rxjava3.core.Observable
import io.reactivex.rxjava3.core.Single
import io.reactivex.rxjava3.core.SingleSource
import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.internal.operators.observable.ObservableIgnoreElementsCompletable
import io.reactivex.rxjava3.internal.operators.observable.ObservableJust
import io.reactivex.rxjava3.internal.operators.observable.ObservableScan
import io.reactivex.rxjava3.schedulers.Schedulers
import kotlinx.coroutines.newFixedThreadPoolContext
import java.lang.StringBuilder
import java.nio.ByteBuffer
import java.util.UUID
//import com.gtdvm.echopoint.Utils.getMajor
//import com.gtdvm.echopoint.Utils.getMinor
//import com.gtdvm.echopoint.Utils.getUUID
import org.altbeacon.beacon.BeaconManager
import org.altbeacon.beacon.BeaconParser
import org.altbeacon.beacon.MonitorNotifier
import org.altbeacon.beacon.RangeNotifier
import org.altbeacon.beacon.Region
import org.altbeacon.beacon.*

//import android.window.OnBackInvokedCallback
//import android.window.OnBackInvokedDispatcher
//import androidx.activity.OnBackPressedCallback

//import androidx.core.app.ComponentActivity
//import androidx.activity.result.ActivityResultLauncher
//import androidx.activity.result.ActivityResult
//import androidx.activity.result.ActivityResultCallback
//import android.Manifest

class BluetoothServices(private val activity: AppCompatActivity): RangeNotifier, MonitorNotifier {
private var managerDevices: ManagerDevices = ManagerDevices(activity)
private var beaconManager: BeaconManager = BeaconManager.getInstanceForApplication(activity)
private var rxBleClient: RxBleClient = RxBleClient.create(activity)
var currentBleConnection: RxBleConnection? = null
private var selectedRxBleDeviceClient: RxBleDevice? = null
private var scanDisposable: Disposable? = null
private var connectionDisposable: Disposable? = null
//private val compositeDisposable = CompositeDisposable()
private var personalBleService: BluetoothGattService? = null
private var notificationCaracteristic: BluetoothGattCharacteristic? = null
private var writeCaracteristic: BluetoothGattCharacteristic? = null
private var descriptorBLE2902: BluetoothGattDescriptor? = null
private val devicesFound = mutableListOf()

private val bleUUID = "A134D0B2-1DA2-1BA7-C94C-E8E00C9F7A2D" //"2D7A9F0C-E0E8-4CC9-A71B-A21DB2D034A1"
private val servicesUUID = "6E400001-B5A3-F393-E0A9-E50E24DCCA9E"
private val writeCharacteristicUUID = "6E400002-B5A3-F393-E0A9-E50E24DCCA9E"
private val notificationUUID = "6E400003-B5A3-F393-E0A9-E50E24DCCA9E"
private val descriptorBLE2902UUID = "00002902-0000-1000-8000-00805f9b34fb"


private val notificationViewNodel: NotificationViewModel by lazy { ViewModelProvider(activity)[NotificationViewModel::class.java] }
private val iBeaconsView: IBeaconsView by lazy { ViewModelProvider(activity)[IBeaconsView::class.java] }
private val myIBeaconsRegion: Region = Region("myUniqueBeaconRegion", Identifier.parse(bleUUID), null, null)

init {
    beaconManager.beaconParsers.add(BeaconParser(bleUUID).setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"))

//beaconManager.foregroundScanPeriod = 16000L
// beaconManager.foregroundBetweenScanPeriod = 0L
beaconManager.backgroundMode = false
beaconManager.addMonitorNotifier(this)
beaconManager.addRangeNotifier(this)
}

@SuppressLint("CheckResult")
fun connectToDevice (deviceMacAddres: String){
    //notificationViewNodel.showNotificationData("connecting...")
   selectedRxBleDeviceClient = rxBleClient.getBleDevice(deviceMacAddres)
    connectionDisposable?.dispose()
      connectionDisposable = selectedRxBleDeviceClient?.establishConnection(false)
          ?.subscribe({ result ->
              currentBleConnection = result
              notificationViewNodel.showNotificationData(activity.getString(R.string.Message_After_Connecting))
              result.discoverBleServices()
                  .subscribe({service ->
                      if (service.uuid == UUID.fromString(servicesUUID)){
                          personalBleService = service
                          result.enableNotificationCharacteristic()
                              ?.subscribe({ resultData ->
                                  notificationViewNodel.showNotificationData(resultData.decodeToString())
                              }, {

                              })
                      }
                  },{

                  })
          },{

          })
}

private fun RxBleConnection.discoverBleServices (): Observable<BluetoothGattService> {
    return this.discoverServices()
            .toObservable()
            .flatMap{services ->
                val myBleServices = services.bluetoothGattServices.find { it.uuid == UUID.fromString(servicesUUID) }
                if (myBleServices != null) {
                    discoveryCharacteristics(myBleServices)
                        .flatMap { characteristics ->
                            when (characteristics.uuid) {
                                UUID.fromString(notificationUUID) -> {
                                    notificationCaracteristic = characteristics
                                    Log.d("FINDING_CARACTERISTIC", "notification caracteristic are uuid: $notificationCaracteristic.uuid, property: $notificationCaracteristic.properties, permission: $notificationCaracteristic.permissions")
                                    notificationCaracteristic?.let {descriptorBLE2902 = it.getDescriptor(UUID.fromString(descriptorBLE2902UUID))}
                                }
                                UUID.fromString(writeCharacteristicUUID) -> {
                                    writeCaracteristic = characteristics
                                    Log.d("FINDING_CHARACTERISTIC", "write caracteristic are uuid: $writeCaracteristic.uuid, permission: $writeCaracteristic.permissions, properties: $writeCaracteristic.properties")
                                }
                            }
                            Observable.just(myBleServices)
                        }
                } else {
                    Observable.error(Throwable("serviciu cu uuid specificat nu afost gasit"))
                }
            }
}

private fun discoveryCharacteristics (service: BluetoothGattService): Observable<BluetoothGattCharacteristic> {
    return Observable.fromIterable(service.characteristics)
}

@SuppressLint("CheckResult")
fun writeBleCharacteristic (connection: RxBleConnection, sendingData: ByteArray) {
    try {
        Log.e("WRITE-CHARACTERISTIC", "function de scrierea characteristic sa apelat ")
        if (writeCaracteristic != null && writeCaracteristic!!.uuid == UUID.fromString(writeCharacteristicUUID)){
            val pew = writeCaracteristic!!.permissions// and
            val prw = writeCaracteristic!!.properties// and PROPERTY_WRITE
            val ptw = writeCaracteristic!!.writeType
            Log.e("CARACTERISTIC_PERMISSION", "caracteristica are permission $pew , properties :$prw, type: $ptw ")
            Log.e("VALUE", "property: $PROPERTY_WRITE, permission: $PERMISSION_WRITE")
            if ( prw == PROPERTY_WRITE){
                Log.e("WRITE-CHARACTERISTIC", "caracteristica are aces sa scrie ")
                when (ptw){
                    WRITE_TYPE_DEFAULT -> {
                        writeCaracteristic!!.writeType = WRITE_TYPE_DEFAULT
                        Log.e("WRITE_MDE", "set write mode default")
                    }
                    WRITE_TYPE_NO_RESPONSE ->{
                        writeCaracteristic!!.writeType = WRITE_TYPE_NO_RESPONSE
                        Log.e("WRITE_MODE", "no response write mode has been set")
                    }
                }
                connection.writeCharacteristic(writeCaracteristic!!, sendingData)
                    .subscribe({sucesedValue ->
                        if (sucesedValue.isNotEmpty()){
                            Log.e("WRITE-CHARACTERISTIC", "the writing feature confirmed with: ${sucesedValue.decodeToString()}")
                        }
                    },{throwable ->

//if (throwable is RxB){

//}
})
} else{
Log.e("ERROR", "Caracteristica nu poate fii scrisa")
}
} else{
Log.e("ERROR", "nu sa găsit caracteristica cu uuid specificat")
}
} catch (e: Exception){
Log.e("EXCEPTION", "$e")
}
}

@SuppressLint("CheckResult")
private fun RxBleConnection.enableNotificationCharacteristic (): Observable? {
Log.e("NOTIFICATION-CHARACTERISTIC", "the notify function was called")
return if (notificationCaracteristic != null && notificationCaracteristic?.uuid == UUID.fromString(notificationUUID)){
Log.e("NOTIFICATION-CHARACTERISTIC", "caracteristica nu este null")
val prn = notificationCaracteristic!!.properties and PROPERTY_NOTIFY
val pen = notificationCaracteristic!!.permissions and PERMISSION_READ
Log.d("INFORMATION_CHARACTERISTIC", "propriety: $prn permission: $pen")
if (prn == PROPERTY_NOTIFY){
Log.d("MESSAGE", "are permissions for notification")
this.setupNotification(notificationCaracteristic!!)
.flatMap{notificationObservable ->
if (!this.isEnabledDescriptor2902()){
Log.d("DESCRIPTOR_STATUS", "descriptor status is disabled")
this.writeDescriptor(descriptorBLE2902!!, BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE)
.subscribe({
Log.d("WRITE_DESCRIPTOR_STATUS", "descriptor was written successfully")
},{
Log.d("WRITE_DESCRIPTOR_STATUS", "an error occurred when writing the descriptor")
})
}
notificationObservable}
} else{
Log.d("ERROR", "cannot permissions for notification")
Observable.error(Throwable("caracteristica de notification nu se citeste sau de activat notification"))
}
} else{
Observable.error(Throwable("caracteristica cu UUID specificat nu afost găsit sau este null"))
}
}

private fun RxBleConnection.isEnabledDescriptor2902(): Boolean{
   descriptorBLE2902.let {
          val descriptor2902 = this.readDescriptor(descriptorBLE2902!!)
      return descriptor2902?.equals(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE) ?: false
    }
}

fun disConnect (){
    try {
        connectionDisposable?.dispose()
        currentBleConnection?.let {
            currentBleConnection = null
                         //compositeDisposable.dispose()
        }
    } catch (error: Exception){
        Log.e("DISCONNECT_ERROR", "eroarea este: $error.message")
    }
}

override fun didRangeBeaconsInRegion(beacons: MutableCollection<Beacon>?, region: Region?) {

beacons?.forEach{beacon ->
if (isPointer(beacon.id1)){
val iBeacon = IBeacon(beacon.bluetoothAddress)
iBeacon.uuid = beacon.id1.toString()
iBeacon.major = beacon.id2.toInt()
iBeacon.minor = beacon.id3.toInt()
iBeacon.rssi = beacon.rssi
iBeacon.manufacturer = beacon.manufacturer.toString()
devicesFound.add(iBeacon)
iBeaconsView.updateListIBeacons(devicesFound)
}
}
}

override fun didEnterRegion(region: Region?) {

}

override fun didExitRegion(region: Region?) {
    if (devicesFound.any { it.macAddress == region?.bluetoothAddress }){

this.removeDeviceOfList(region?.bluetoothAddress)
iBeaconsView.updateListIBeacons(devicesFound)
}
}

override fun didDetermineStateForRegion(state: Int, region: Region?) {

when (state) {
MonitorNotifier.INSIDE -> Log.d("BeaconMonitoring", "Inside region: ${region?.uniqueId}")
MonitorNotifier.OUTSIDE -> Log.d("BeaconMonitoring", "Outside region: ${region?.uniqueId}")
}
}

fun startBluetoothScan () {
                 if (managerDevices.areBluetoothPermissionsGranted() && managerDevices.isBluetoothEnabled() && managerDevices.isLocationActive()) {


                try {
                    beaconManager.startMonitoring(myIBeaconsRegion)
                    beaconManager.startRangingBeacons(myIBeaconsRegion)
                } catch (e: RemoteException){

e.printStackTrace()
//emiter.onError(e)
}
//return devicesFound
}
}

fun stopScan () {
    scanDisposable?.dispose()
    //val region = Region("myRangingUniqueId", null, null, null)
    try {
        beaconManager.stopMonitoring(myIBeaconsRegion)
        beaconManager.stopRangingBeacons(myIBeaconsRegion)
    } catch (e: RemoteException){

e.printStackTrace()
}
}

private fun isPointer(deviceUUID: Identifier): Boolean {
    return deviceUUID.toString().equals(bleUUID, ignoreCase = true)
}

private fun removeDeviceOfList(deviceMacAddres: String?){
    devicesFound.forEachIndexed { index, iBeacon ->
        if (iBeacon.macAddress == deviceMacAddres){
            devicesFound.removeAt(index)
            return@forEachIndexed
        }
    }
}

}

this is the manifesto

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<uses-feature android:name="android.hardware.bluetooth" android:required="true" />
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />



<!--
    <uses-permission android:name="android.permission.BLUETOOTH_SCAN" tools:node="replace" />
    <uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" android:maxSdkVersion="31" />
                       <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-->


<application
    android:enableOnBackInvokedCallback="true"
    android:allowBackup="true"
    android:dataExtractionRules="@xml/data_extraction_rules"
    android:fullBackupContent="@xml/backup_rules"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/Theme.EchoPoint"
    tools:targetApi="tiramisu">
    <activity
        android:name=".ScanAndCommunicationSelectedDevice"
        android:exported="false" />
    <activity
        android:name=".CommunicationWithTheDevice"
        android:exported="false" />
    <activity
        android:name=".ListDevices"
        android:exported="false" />
    <activity
        android:name=".UnderCategory"
        android:exported="false"
        android:label="@string/title_activity_under_category"
        android:theme="@style/Theme.EchoPoint.NoActionBar" />
    <activity
        android:name=".MainActivity"
        android:exported="true"
        android:theme="@style/Theme.EchoPoint">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>



    <service android:name="org.altbeacon.beacon.service.ScanJob" android:permission="android.permission.BIND_JOB_SERVICE" />
    <meta-data android:name="android.app.job.JobScheduler.SCHEDULE_IMMEDIATE" android:value="true"/>
    <!--
                    <service android:name="org.altbeacon.beacon.service.ScanJob" android:exported="true" android:permission="android.permission.BIND_JOB_SERVICE">
                                                    </service>


                        <intent-filter>
            <action android:name="com.gtdvm.echopoint.SCAN_JOB" />
                            <action android:name="android.intent.action.BOOT_COMPLETED"/>
                        </intent-filter>

                                <meta-data android:name="android.service.jobscheduler.schedule"
                            android:value="{'preferred_network':'none','preferred_deferred':1000,'periodic':true,'backoffPolicy':'exponential','flex':300}"/>


                                            <service android:name="org.altbeacon.beacon.service.BeaconService" />


                                    <service android:exported="false" android:isolatedProcess="false" android:label="BeaconService" android:name="org.altbeacon.beacon.service.BeaconService" tools:replace="android:label" />
                                    <service android:exported="false" android:isolatedProcess="false" android:label="BeaconIntentProcessor" android:name="org.altbeacon.beacon.BeaconIntentProcessor" />
                                    <service android:name="org.altbeacon.beacon.service.ScanJob"
                                        android:permission="android.permission.BIND_JOB_SERVICE" android:exported="true" android:label="ScanJob" tools:replace="android:exported">
                                        <intent-filter>
                                            <action android:name="com.gtdvm.echopoint.SCAN_JOB"/>
                                            <action android:name="android.intent.action.BOOT_COMPLETED"/>
                                        </intent-filter>
                                        <meta-data android:name="android.app.job.JobScheduler.SCHEDULE_IMMEDIATE" android:value="true"/>
                                        <meta-data android:name="android.service.jobscheduler.schedule" android:value="{'preferred_network':'none','preferred_deferred':1000,'periodic':true,'backoffPolicy':'exponential','flex':300}"/>
                                    </service>

                                    <receiver android:exported="false" android:label="BeaconReceiver" android:name="org.altbeacon.beacon.startup.StartupBroadcastReceiver">
                                    <intent-filter>
                                        <action android:name="android.intent.action.BOOT_COMPLETED"/>
                                        <action android:name="android.intent.action.ACTION_SHUTDOWN"/>
                                    </intent-filter>
                            </receiver  >
                                -->
</application>

I don't know and don't understand if I am doing something wrong or if there is a problem with the altbeacon library or with Android. So please, anyone who has experience and knowledge, help me understand how I can solve this problem.

@VolodaUa
Copy link
Contributor

@G-Roman1988 Could you please attach minimal reproducible sample? I can confirm that this library detects IBeacon Beacons on Android 12+.

@G-Roman1988
Copy link
Author

Hello! Thanks for the reply. of course I attach some logs. these logs are recent and from google pixely 6 android 14 phone.  2024-06-28 15:30:40.528  9015-9015  BeaconManager           com.gtdvm.echopoint                  I  BeaconManager started up on pid 9015 named 'com.gtdvm.echopoint' for application package 'com.gtdvm.echopoint'.  isMainProcess=true
2024-06-28 15:30:40.531  9015-9015  BeaconParser            com.gtdvm.echopoint                  D  Parsing beacon layout: m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25
2024-06-28 15:30:40.546  9015-9015  Compatibil...geReporter com.gtdvm.echopoint                  D  Compat change id reported: 263076149; UID 10316; state: ENABLED
2024-06-28 15:30:40.549  9015-9015  BeaconParser            com.gtdvm.echopoint                  D  Parsing beacon layout: m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24
2024-06-28 15:30:40.565  9015-9015  LOCATION-MANAGER        com.gtdvm.echopoint                  D  locationManager is : true
2024-06-28 15:30:40.568  9015-9015  BackgroundPowerSaver    com.gtdvm.echopoint                  I  Background mode not set.  We assume we are in the foreground.
2024-06-28 15:30:40.605  9015-9015  ScanJob                 com.gtdvm.echopoint                  I  Using immediateScanJobId from manifest: 208352939
2024-06-28 15:30:40.605  9015-9015  Compatibil...geReporter com.gtdvm.echopoint                  D  Compat change id reported: 194532703; UID 10316; state: ENABLED
2024-06-28 15:30:40.606  9015-9015  Compatibil...geReporter com.gtdvm.echopoint                  D  Compat change id reported: 253665015; UID 10316; state: ENABLED
2024-06-28 15:30:40.606  9015-9015  Compatibil...geReporter com.gtdvm.echopoint                  D  Compat change id reported: 311402873; UID 10316; state: DISABLED
2024-06-28 15:30:40.606  9015-9015  Compatibil...geReporter com.gtdvm.echopoint                  D  Compat change id reported: 323349338; UID 10316; state: DISABLED
2024-06-28 15:30:40.606  9015-9015  JobInfo                 com.gtdvm.echopoint                  W  Job 'com.gtdvm.echopoint/org.altbeacon.beacon.service.ScanJob#208352939' has a deadline with no functional constraints. The deadline won't improve job execution latency. Consider removing the deadline.
2024-06-28 15:30:40.608  9015-9015  ScanJob                 com.gtdvm.echopoint                  I  Using periodicScanJobId from manifest: 208352940
2024-06-28 15:30:40.608  9015-9015  JobInfo                 com.gtdvm.echopoint                  W  Requested interval +5m0s0ms for job 208352940 is too small; raising to +15m0s0ms
2024-06-28 15:30:40.608  9015-9015  JobInfo                 com.gtdvm.echopoint                  W  Requested flex 0 for job 208352940 is too small; raising to +5m0s0ms
2024-06-28 15:30:40.608  9015-9015  BeaconMonitoring        com.gtdvm.echopoint                  D  Outside region: myUniqueBeaconRegion
2024-06-28 15:30:40.621  9015-9015  ScanJob                 com.gtdvm.echopoint                  I  Using immediateScanJobId from manifest: 208352939
2024-06-28 15:30:40.621  9015-9015  JobInfo                 com.gtdvm.echopoint                  W  Job 'com.gtdvm.echopoint/org.altbeacon.beacon.service.ScanJob#208352939' has a deadline with no functional constraints. The deadline won't improve job execution latency. Consider removing the deadline.
2024-06-28 15:30:40.623  9015-9015  ScanJob                 com.gtdvm.echopoint                  I  Using periodicScanJobId from manifest: 208352940
2024-06-28 15:30:40.623  9015-9015  JobInfo                 com.gtdvm.echopoint                  W  Requested interval +5m0s0ms for job 208352940 is too small; raising to +15m0s0ms
2024-06-28 15:30:40.623  9015-9015  JobInfo                 com.gtdvm.echopoint                  W  Requested flex 0 for job 208352940 is too small; raising to +5m0s0ms
2024-06-28 15:30:40.627  9015-9015  ContentCaptureHelper    com.gtdvm.echopoint                  I  Setting logging level to OFF
2024-06-28 15:30:40.679  9015-9015  ScanJob                 com.gtdvm.echopoint                  I  ScanJob Lifecycle START: org.altbeacon.beacon.service.ScanJob@e59b6e5
2024-06-28 15:30:40.724  9015-9686  ScanHelper              com.gtdvm.echopoint                  D  BeaconParsers set to  count: 2
2024-06-28 15:30:40.724  9015-9686  ScanHelper              com.gtdvm.echopoint                  D  First parser layout: m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25
2024-06-28 15:30:40.725  9015-9686  CycledLeScanner         com.gtdvm.echopoint                  I  Using Android O scanner
2024-06-28 15:30:40.728  9015-9686  ScanJob                 com.gtdvm.echopoint                  I  Using immediateScanJobId from manifest: 208352939
2024-06-28 15:30:40.728  9015-9686  ScanJob                 com.gtdvm.echopoint                  I  Running immediate scan job: instance is org.altbeacon.beacon.service.ScanJob@e59b6e5
2024-06-28 15:30:40.728  9015-9686  ScanJob                 com.gtdvm.echopoint                  I  scanJob version 2.20.6 is starting up on the main process
2024-06-28 15:30:40.742  9015-9686  ModelSpeci...Calculator com.gtdvm.echopoint                  W  Cannot find match for this device.  Using default
2024-06-28 15:30:40.742  9015-9686  ModelSpeci...Calculator com.gtdvm.echopoint                  W  Cannot find match for this device.  Using default
2024-06-28 15:30:40.743  9015-9686  Compatibil...geReporter com.gtdvm.echopoint                  D  Compat change id reported: 160794467; UID 10316; state: ENABLED
2024-06-28 15:30:40.744  9015-9686  BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-28 15:30:40.748  9015-9687  BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-28 15:30:40.748  9015-9686  ScanJob                 com.gtdvm.echopoint                  I  Scan job running for 300000 millis
2024-06-28 15:30:40.751  9015-9047  BluetoothLeScanner      com.gtdvm.echopoint                  D  onScannerRegistered() - status=0 scannerId=2 mScannerId=0
2024-06-28 15:30:41.176  9015-9015  VRI[MainActivity]       com.gtdvm.echopoint                  D  visibilityChanged oldVisibility=true newVisibility=false
2024-06-28 15:30:47.378  9015-9687  BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-28 15:30:47.406  9015-9687  BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-28 15:30:47.414  9015-9048  BluetoothLeScanner      com.gtdvm.echopoint                  D  onScannerRegistered() - status=0 scannerId=2 mScannerId=0
2024-06-28 15:30:52.560  9015-9015  ScanJob                 com.gtdvm.echopoint                  I  Using immediateScanJobId from manifest: 208352939
2024-06-28 15:30:52.561  9015-9015  JobInfo                 com.gtdvm.echopoint                  W  Job 'com.gtdvm.echopoint/org.altbeacon.beacon.service.ScanJob#208352939' has a deadline with no functional constraints. The deadline won't improve job execution latency. Consider removing the deadline.
2024-06-28 15:30:52.563  9015-9015  ScanJob                 com.gtdvm.echopoint                  I  Using periodicScanJobId from manifest: 208352940
2024-06-28 15:30:52.563  9015-9015  JobInfo                 com.gtdvm.echopoint                  W  Requested interval +5m0s0ms for job 208352940 is too small; raising to +15m0s0ms
2024-06-28 15:30:52.563  9015-9015  JobInfo                 com.gtdvm.echopoint                  W  Requested flex 0 for job 208352940 is too small; raising to +5m0s0ms
2024-06-28 15:30:52.591  9015-9015  ScanJob                 com.gtdvm.echopoint                  I  Using immediateScanJobId from manifest: 208352939
2024-06-28 15:30:52.593  9015-9015  ScanJob                 com.gtdvm.echopoint                  I  Using periodicScanJobId from manifest: 208352940
2024-06-28 15:30:52.595  9015-9015  BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-28 15:30:52.597  9015-9015  BeaconManager           com.gtdvm.echopoint                  I  Cancelling scheduled jobs after unbind of last consumer.
2024-06-28 15:30:52.598  9015-9015  ScanJob                 com.gtdvm.echopoint                  I  Using immediateScanJobId from manifest: 208352939
2024-06-28 15:30:52.598  9015-9015  ScanJob                 com.gtdvm.echopoint                  I  Using periodicScanJobId from manifest: 208352940
2024-06-28 15:30:52.608  9015-9015  ScanJob                 com.gtdvm.echopoint                  I  Using periodicScanJobId from manifest: 208352940
2024-06-28 15:30:52.608  9015-9015  ScanJob                 com.gtdvm.echopoint                  I  onStopJob called for immediate scan org.altbeacon.beacon.service.ScanJob@e59b6e5
2024-06-28 15:30:52.608  9015-9015  ScanJob                 com.gtdvm.echopoint                  I  ScanJob Lifecycle STOP: org.altbeacon.beacon.service.ScanJob@e59b6e5
2024-06-28 15:30:52.608  9015-9015  BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-28 15:30:52.609  9015-9687  BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-28 15:30:52.611  9015-9015  BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-28 15:30:52.611  9015-9687  BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-28 15:30:52.614  9015-9687  BluetoothLeScanner      com.gtdvm.echopoint                  D  could not find callback wrapper
2024-06-28 15:30:52.621  9015-9015  WindowOnBackDispatcher  com.gtdvm.echopoint                  W  sendCancelIfRunning: isInProgress=falsecallback=android.app.Activity$$ExternalSyntheticLambda0@7fec78f
2024-06-28 15:30:52.649  9015-9015  LOCATION-MANAGER        com.gtdvm.echopoint                  D  locationManager is : true
2024-06-28 15:30:52.654  9015-9015  ContentCaptureHelper    com.gtdvm.echopoint                  I  Setting logging level to OFF
2024-06-28 15:30:53.212  9015-9015  VRI[ListDevices]        com.gtdvm.echopoint                  D  visibilityChanged oldVisibility=true newVisibility=false
2024-06-28 15:30:53.228  9015-9015  WindowOnBackDispatcher  com.gtdvm.echopoint                  W  sendCancelIfRunning: isInProgress=falsecallback=androidx.activity.OnBackPressedDispatcher$Api34Impl$createOnBackAnimationCallback$1@b310a26
2024-06-28 15:30:53.233  9015-9015  WindowOnBackDispatcher  com.gtdvm.echopoint                  W  sendCancelIfRunning: isInProgress=falsecallback=android.app.Activity$$ExternalSyntheticLambda0@4978981
 but these logs are from Samsung A52 Android 13. 
2024-06-09 16:16:28.161 32216-32216 Compatibil...geReporter com.gtdvm.echopoint                  D  Compat change id reported: 280005585; UID 10316; state: DISABLED
2024-06-09 16:16:28.200 32216-32216 Compatibil...geReporter com.gtdvm.echopoint                  D  Compat change id reported: 147798919; UID 10316; state: ENABLED
2024-06-09 16:16:33.652 32216-32344 ProfileInstaller        com.gtdvm.echopoint                  D  Installing profile for com.gtdvm.echopoint
2024-06-09 16:16:34.034 32216-32216 BeaconManager           com.gtdvm.echopoint                  I  BeaconManager started up on pid 32216 named 'com.gtdvm.echopoint' for application package 'com.gtdvm.echopoint'.  isMainProcess=true
2024-06-09 16:16:34.036 32216-32216 BeaconParser            com.gtdvm.echopoint                  D  Parsing beacon layout: m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25
2024-06-09 16:16:34.050 32216-32216 Compatibil...geReporter com.gtdvm.echopoint                  D  Compat change id reported: 263076149; UID 10316; state: ENABLED
2024-06-09 16:16:34.053 32216-32216 BeaconParser            com.gtdvm.echopoint                  D  Parsing beacon layout: m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24
2024-06-09 16:16:34.057 32216-32216 LOCATION-MANAGER        com.gtdvm.echopoint                  D  locationManager is : true
2024-06-09 16:16:34.085 32216-32216 ScanJob                 com.gtdvm.echopoint                  I  Using immediateScanJobId from manifest: 208352939
2024-06-09 16:16:34.085 32216-32216 Compatibil...geReporter com.gtdvm.echopoint                  D  Compat change id reported: 194532703; UID 10316; state: ENABLED
2024-06-09 16:16:34.085 32216-32216 Compatibil...geReporter com.gtdvm.echopoint                  D  Compat change id reported: 253665015; UID 10316; state: ENABLED
2024-06-09 16:16:34.085 32216-32216 Compatibil...geReporter com.gtdvm.echopoint                  D  Compat change id reported: 311402873; UID 10316; state: DISABLED
2024-06-09 16:16:34.088 32216-32216 ScanJob                 com.gtdvm.echopoint                  I  Using periodicScanJobId from manifest: 208352940
2024-06-09 16:16:34.088 32216-32216 JobInfo                 com.gtdvm.echopoint                  W  Requested interval +5m0s0ms for job 208352940 is too small; raising to +15m0s0ms
2024-06-09 16:16:34.088 32216-32216 JobInfo                 com.gtdvm.echopoint                  W  Requested flex 0 for job 208352940 is too small; raising to +5m0s0ms
2024-06-09 16:16:34.091 32216-32216 ContentCaptureHelper    com.gtdvm.echopoint                  I  Setting logging level to OFF
2024-06-09 16:16:34.152 32216-32216 ScanJob                 com.gtdvm.echopoint                  I  ScanJob Lifecycle START: org.altbeacon.beacon.service.ScanJob@2e8a313
2024-06-09 16:16:34.162 32216-32352 ScanHelper              com.gtdvm.echopoint                  D  BeaconParsers set to  count: 2
2024-06-09 16:16:34.162 32216-32352 ScanHelper              com.gtdvm.echopoint                  D  First parser layout: m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25
2024-06-09 16:16:34.163 32216-32352 CycledLeScanner         com.gtdvm.echopoint                  I  Using Android O scanner
2024-06-09 16:16:34.164 32216-32352 ScanJob                 com.gtdvm.echopoint                  I  Using immediateScanJobId from manifest: 208352939
2024-06-09 16:16:34.164 32216-32352 ScanJob                 com.gtdvm.echopoint                  I  Running immediate scan job: instance is org.altbeacon.beacon.service.ScanJob@2e8a313
2024-06-09 16:16:34.165 32216-32352 ScanJob                 com.gtdvm.echopoint                  I  scanJob version 2.20.6 is starting up on the main process
2024-06-09 16:16:34.177 32216-32352 ModelSpeci...Calculator com.gtdvm.echopoint                  W  Cannot find match for this device.  Using default
2024-06-09 16:16:34.177 32216-32352 ModelSpeci...Calculator com.gtdvm.echopoint                  W  Cannot find match for this device.  Using default
2024-06-09 16:16:34.178 32216-32352 Compatibil...geReporter com.gtdvm.echopoint                  D  Compat change id reported: 160794467; UID 10316; state: ENABLED
2024-06-09 16:16:34.178 32216-32352 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:16:34.182 32216-32352 ScanJob                 com.gtdvm.echopoint                  I  Scan job running for 300000 millis
2024-06-09 16:16:34.182 32216-32355 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:16:34.184 32216-32307 BluetoothLeScanner      com.gtdvm.echopoint                  D  onScannerRegistered() - status=0 scannerId=3 mScannerId=0
2024-06-09 16:16:34.620 32216-32216 VRI[MainActivity]       com.gtdvm.echopoint                  D  visibilityChanged oldVisibility=true newVisibility=false
2024-06-09 16:16:34.639 32216-32216 VRI[MainActivity]       com.gtdvm.echopoint                  D  Not drawing due to not visible
2024-06-09 16:16:39.697 32216-32227 gtdvm.echopoint         com.gtdvm.echopoint                  I  Background concurrent mark compact GC freed 51865(14MB) AllocSpace objects, 1(20KB) LOS objects, 84% free, 4489KB/28MB, paused 547us,5.135ms total 68.723ms
2024-06-09 16:16:40.804 32216-32355 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:16:40.814 32216-32355 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:16:40.823 32216-32353 BluetoothLeScanner      com.gtdvm.echopoint                  D  onScannerRegistered() - status=0 scannerId=3 mScannerId=0
2024-06-09 16:16:47.436 32216-32355 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:16:47.460 32216-32355 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:16:47.471 32216-32232 BluetoothLeScanner      com.gtdvm.echopoint                  D  onScannerRegistered() - status=0 scannerId=3 mScannerId=0
2024-06-09 16:16:54.083 32216-32355 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:16:54.107 32216-32355 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:16:54.123 32216-32307 BluetoothLeScanner      com.gtdvm.echopoint                  D  onScannerRegistered() - status=0 scannerId=3 mScannerId=0
2024-06-09 16:17:00.728 32216-32355 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:17:00.743 32216-32355 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:17:00.755 32216-32307 BluetoothLeScanner      com.gtdvm.echopoint                  D  onScannerRegistered() - status=0 scannerId=3 mScannerId=0
2024-06-09 16:17:07.351 32216-32355 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:17:07.365 32216-32355 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:17:07.379 32216-32353 BluetoothLeScanner      com.gtdvm.echopoint                  D  onScannerRegistered() - status=0 scannerId=3 mScannerId=0
2024-06-09 16:17:13.991 32216-32355 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:17:14.019 32216-32355 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:17:14.031 32216-32353 BluetoothLeScanner      com.gtdvm.echopoint                  D  onScannerRegistered() - status=0 scannerId=3 mScannerId=0
2024-06-09 16:17:20.623 32216-32355 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:17:20.644 32216-32355 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:17:20.656 32216-32353 BluetoothLeScanner      com.gtdvm.echopoint                  D  onScannerRegistered() - status=0 scannerId=3 mScannerId=0
2024-06-09 16:17:24.605 32216-32216 ScanJob                 com.gtdvm.echopoint                  I  Using immediateScanJobId from manifest: 208352939
2024-06-09 16:17:24.606 32216-32216 ScanJob                 com.gtdvm.echopoint                  I  Using periodicScanJobId from manifest: 208352940
2024-06-09 16:17:24.611 32216-32216 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:17:24.631 32216-32216 ScanJob                 com.gtdvm.echopoint                  I  Using periodicScanJobId from manifest: 208352940
2024-06-09 16:17:24.631 32216-32216 ScanJob                 com.gtdvm.echopoint                  I  onStopJob called for immediate scan org.altbeacon.beacon.service.ScanJob@2e8a313
2024-06-09 16:17:24.631 32216-32216 ScanJob                 com.gtdvm.echopoint                  I  ScanJob Lifecycle STOP: org.altbeacon.beacon.service.ScanJob@2e8a313
2024-06-09 16:17:24.631 32216-32216 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:17:24.633 32216-32355 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:17:24.634 32216-32216 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:17:24.635 32216-32355 BluetoothAdapter        com.gtdvm.echopoint                  D  isLeEnabled(): ON
2024-06-09 16:17:24.637 32216-32355 BluetoothLeScanner      com.gtdvm.echopoint                  D  could not find callback wrapper
2024-06-09 16:17:24.644 32216-32216 WindowOnBackDispatcher  com.gtdvm.echopoint                  W  sendCancelIfRunning: isInProgress=falsecallback=android.app.Activity$$ExternalSyntheticLambda0@e3af302
2024-06-09 16:17:24.674 32216-32216 LOCATION-MANAGER        com.gtdvm.echopoint                  D  locationManager is : true
2024-06-09 16:17:24.680 32216-32216 ContentCaptureHelper    com.gtdvm.echopoint                  I  Setting logging level to OFF
2024-06-09 16:17:25.246 32216-32216 VRI[ListDevices]        com.gtdvm.echopoint                  D  visibilityChanged oldVisibility=true newVisibility=false
2024-06-09 16:17:25.265 32216-32216 VRI[ListDevices]        com.gtdvm.echopoint                  D  Not drawing due to not visible
2024-06-09 16:17:25.266 32216-32216 WindowOnBackDispatcher  com.gtdvm.echopoint                  W  sendCancelIfRunning: isInProgress=falsecallback=androidx.activity.OnBackPressedDispatcher$Api34Impl$createOnBackAnimationCallback$1@c150e1c
2024-06-09 16:17:25.269 32216-32216 WindowOnBackDispatcher  com.gtdvm.echopoint                  W  sendCancelIfRunning: isInProgress=falsecallback=android.app.Activity$$ExternalSyntheticLambda0@ef5eb8f
  these logs are still on android 14 google pixely 6 but from the beginning when i decided to use the altbeacon library.  2024-06-17 22:34:23.428 24925-24960 BluetoothAdapter        com.gtdvm.echopoint                  I  STATE_ON
2024-06-17 22:34:23.428 24925-24960 BluetoothLeScanner      com.gtdvm.echopoint                  D  Stop Scan with callback
2024-06-17 22:34:23.432 24925-24960 BluetoothAdapter        com.gtdvm.echopoint                  I  STATE_ON
2024-06-17 22:34:23.433 24925-24960 BluetoothAdapter        com.gtdvm.echopoint                  I  STATE_ON
2024-06-17 22:34:23.433 24925-24960 BluetoothAdapter        com.gtdvm.echopoint                  I  STATE_ON
2024-06-17 22:34:23.433 24925-24960 BluetoothLeScanner      com.gtdvm.echopoint                  D  Start Scan with callback
2024-06-17 22:34:23.435  4926-5473  BtGatt.GattService      com.android.bluetooth                E  [GSIM LOG]: gsimLogHandler, msg: MESSAGE_SCAN_STOP, appName: com.gtdvm.echopoint, scannerId: 10, reportDelayMillis=0
2024-06-17 22:34:23.436 24925-24944 BluetoothLeScanner      com.gtdvm.echopoint                  D  onScannerRegistered() - status=0 scannerId=10 mScannerId=0
2024-06-17 22:34:23.443  4926-5473  BtGatt.GattService      com.android.bluetooth                E  [GSIM LOG]: gsimLogHandler, msg: MESSAGE_SCAN_START, appName: com.gtdvm.echopoint, scannerId: 10, reportDelayMillis=0
2024-06-17 22:34:23.645 24925-24925 DecorView               com.gtdvm.echopoint                  I  [INFO] isPopOver=false, config=true
2024-06-17 22:34:23.646 24925-24925 DecorView               com.gtdvm.echopoint                  I  updateCaptionType >> DecorView@5b5a10e[], isFloating=false, isApplication=true, hasWindowDecorCaption=false, hasWindowControllerCallback=true
2024-06-17 22:34:23.646 24925-24925 DecorView               com.gtdvm.echopoint                  D  setCaptionType = 0, this = DecorView@5b5a10e[]
2024-06-17 22:34:23.770 24925-24925 BeaconParser            com.gtdvm.echopoint                  D  Parsing beacon layout: m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24
2024-06-17 22:34:23.837 24925-24925 LOCATION-MANAGER        com.gtdvm.echopoint                  D  locationManager is : true
2024-06-17 22:34:23.840 24925-24925 BackgroundPowerSaver    com.gtdvm.echopoint                  I  Background mode not set.  We assume we are in the foreground.
2024-06-17 22:34:23.872 24925-24925 ScanJob                 com.gtdvm.echopoint                  I  Using immediateScanJobId from manifest: 208352939
2024-06-17 22:34:23.885 24925-24925 ScanJob                 com.gtdvm.echopoint                  I  Using periodicScanJobId from manifest: 208352940
2024-06-17 22:34:23.886 24925-24925 JobInfo                 com.gtdvm.echopoint                  W  Requested interval +5m0s0ms for job 208352940 is too small; raising to +15m0s0ms
2024-06-17 22:34:23.886 24925-24925 JobInfo                 com.gtdvm.echopoint                  W  Requested flex 0 for job 208352940 is too small; raising to +5m0s0ms
2024-06-17 22:34:23.896 24925-24925 AndroidRuntime          com.gtdvm.echopoint                  D  Shutting down VM
2024-06-17 22:34:23.898 24925-24925 AndroidRuntime          com.gtdvm.echopoint                  E  FATAL EXCEPTION: main
                                                                                                    Process: com.gtdvm.echopoint, PID: 24925
                                                                                                    kotlin.NotImplementedError: An operation is not implemented: Not yet implemented
                                                                                                	    at com.gtdvm.echopoint.BluetoothServices.didDetermineStateForRegion(BluetoothServices.kt:300)
                                                                                                	    at org.altbeacon.beacon.BeaconManager.requestStateForRegion(BeaconManager.java:995)
                                                                                                	    at org.altbeacon.beacon.BeaconManager.startMonitoringBeaconsInRegion(BeaconManager.java:1216)
                                                                                                	    at org.altbeacon.beacon.BeaconManager$3.onBeaconServiceConnect(BeaconManager.java:1961)
                                                                                                	    at org.altbeacon.beacon.BeaconManager.bindInternal(BeaconManager.java:463)
                                                                                                	    at org.altbeacon.beacon.BeaconManager.autoBind(BeaconManager.java:1986)
                                                                                                	    at org.altbeacon.beacon.BeaconManager.startMonitoring(BeaconManager.java:1251)
                                                                                                	    at com.gtdvm.echopoint.BluetoothServices.startBluetoothScan(BluetoothServices.kt:309)
                                                                                                	    at com.gtdvm.echopoint.ListDevices.onCreate(ListDevices.kt:35)
                                                                                                	    at android.app.Activity.performCreate(Activity.java:8207)
                                                                                                	    at android.app.Activity.performCreate(Activity.java:8191)
                                                                                                	    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
                                                                                                	    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3819)
                                                                                                	    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4022)
                                                                                                	    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
                                                                                                	    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
                                                                                                	    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
                                                                                                	    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2336)
                                                                                                	    at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                	    at android.os.Looper.loop(Looper.java:246)
                                                                                                	    at android.app.ActivityThread.main(ActivityThread.java:8653)
                                                                                                	    at java.lang.reflect.Method.invoke(Native Method)
                                                                                                	    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
                                                                                                	    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
2024-06-17 22:34:23.931 24925-24925 Process                 com.gtdvm.echopoint                  I  Sending signal. PID: 24925 SIG: 9
2024-06-17 22:34:24.031  4926-5473  BtGatt.GattService      com.android.bluetooth                E  [GSIM LOG]: gsimLogHandler, msg: MESSAGE_SCAN_STOP, appName: com.gtdvm.echopoint, scannerId: 10, reportDelayMillis=0
2024-06-17 22:34:24.033  4926-5473  LeAppInfo               com.android.bluetooth                E  updateScanStopInfo(), There is NO scan process with :                                com.gtdvm.echopoint|    Normal|  LowPower| NonFilter|      true|
2024-06-17 22:34:24.288  4139-4139  audit                   auditd                               E  type=1400 audit(1718652864.283:1038): avc:  granted  { execute } for  pid=25167 comm="re-initialized>" path="/data/data/com.gtdvm.echopoint/code_cache/startup_agents/7acb30f1-agent.so" dev="sda32" ino=2191418 scontext=u:r:untrusted_app:s0:c222,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c222,c257,c512,c768 tclass=file SEPF_SM-A505FN_11_0010 audit_filtered
---------------------------- PROCESS STARTED (25167) for package com.gtdvm.echopoint ----------------------------
2024-06-17 22:34:24.395 25167-25167 gtdvm.echopoin          com.gtdvm.echopoint                  W  ClassLoaderContext classpath size mismatch. expected=0, found=1 (PCL[] | PCL[/data/data/com.gtdvm.echopoint/code_cache/.overlay/base.apk/classes3.dex*16866048])
2024-06-17 22:34:24.399 25167-25167 gtdvm.echopoin          com.gtdvm.echopoint                  W  Found duplicate classes, falling back to extracting from APK : /data/app/~~9HUPxcuFnyOUxENx9aKSOA==/com.gtdvm.echopoint-a7DGZpEmipEoXCz1AKdjZg==/base.apk
2024-06-17 22:34:24.399 25167-25167 gtdvm.echopoin          com.gtdvm.echopoint                  W  NOTE: This wastes RAM and hurts startup performance.
2024-06-17 22:34:24.399 25167-25167 gtdvm.echopoin          com.gtdvm.echopoint                  W  Found duplicated class when checking oat files: 'Lcom/gtdvm/echopoint/BleDevicesAdapter$ViewHolder$$ExternalSyntheticLambda0;' in /data/app/~~9HUPxcuFnyOUxENx9aKSOA==/com.gtdvm.echopoint-a7DGZpEmipEoXCz1AKdjZg==/base.apk!classes3.dex and /data/data/com.gtdvm.echopoint/code_cache/.overlay/base.apk/classes3.dex
2024-06-17 22:34:25.243 25167-25167 LoadedApk               com.gtdvm.echopoint                  D  LoadedApk::makeApplication() appContext=android.app.ContextImpl@89378c3 appContext.mOpPackageName=com.gtdvm.echopoint appContext.mBasePackageName=com.gtdvm.echopoint appContext.mPackageInfo=android.app.LoadedApk@f680540
2024-06-17 22:34:25.243 25167-25167 NetworkSecurityConfig   com.gtdvm.echopoint                  D  No Network Security Config specified, using platform default
2024-06-17 22:34:25.281 25167-25167 NetworkSecurityConfig   com.gtdvm.echopoint                  D  No Network Security Config specified, using platform default
2024-06-17 22:34:25.320 25167-25167 ActivityThread          com.gtdvm.echopoint                  D  handleBindApplication() -- skipGraphicsSupport=false
2024-06-17 22:34:25.338 25167-25167 ScanJob                 com.gtdvm.echopoint                  I  ScanJob Lifecycle START: org.altbeacon.beacon.service.ScanJob@ba93d3b
2024-06-17 22:34:25.381 25167-25196 BeaconManager           com.gtdvm.echopoint                  I  BeaconManager started up on pid 25167 named 'com.gtdvm.echopoint' for application package 'com.gtdvm.echopoint'.  isMainProcess=true
2024-06-17 22:34:25.395 25167-25196 BeaconParser            com.gtdvm.echopoint                  D  Parsing beacon layout: m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25
2024-06-17 22:34:25.599 25167-25196 ScanHelper              com.gtdvm.echopoint                  D  BeaconParsers set to  count: 2
2024-06-17 22:34:25.600 25167-25196 ScanHelper              com.gtdvm.echopoint                  D  First parser layout: m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25
2024-06-17 22:34:25.605 25167-25196 CycledLeScanner         com.gtdvm.echopoint                  I  Using Android O scanner
2024-06-17 22:34:25.621 25167-25196 ScanJob                 com.gtdvm.echopoint                  I  Using immediateScanJobId from manifest: 208352939
2024-06-17 22:34:25.622 25167-25196 ScanJob                 com.gtdvm.echopoint                  I  Running immediate scan job: instance is org.altbeacon.beacon.service.ScanJob@ba93d3b
2024-06-17 22:34:25.624 25167-25196 ScanJob                 com.gtdvm.echopoint                  I  scanJob version 2.20.6 is starting up on the main process
2024-06-17 22:34:25.652 25167-25196 ModelSpeci...Calculator com.gtdvm.echopoint                  W  Cannot find match for this device.  Using default
2024-06-17 22:34:25.653 25167-25196 ModelSpeci...Calculator com.gtdvm.echopoint                  W  Cannot find match for this device.  Using default
2024-06-17 22:34:25.667 25167-25196 BluetoothAdapter        com.gtdvm.echopoint                  I  STATE_ON
2024-06-17 22:34:25.671 25167-25196 BluetoothAdapter        com.gtdvm.echopoint                  I  STATE_ON
2024-06-17 22:34:25.672 25167-25196 BluetoothLeScanner      com.gtdvm.echopoint                  D  Stop Scan with callback intent
2024-06-17 22:34:25.681  4926-5893  BtGatt.ContextMap       com.android.bluetooth                E  Context not found for info creator: com.gtdvm.echopoint(10478), act: null, data: null, type: null, pkg: null, comp: ComponentInfo{com.gtdvm.echopoint/org.altbeacon.beacon.startup.StartupBroadcastReceiver}, categ: null, flag: 0
2024-06-17 22:34:25.702 25167-25196 BluetoothAdapter        com.gtdvm.echopoint                  I  STATE_ON
2024-06-17 22:34:25.705 25167-25200 BluetoothAdapter        com.gtdvm.echopoint                  I  STATE_ON
2024-06-17 22:34:25.705 25167-25196 ScanJob                 com.gtdvm.echopoint                  I  Scan job running for 300000 millis
2024-06-17 22:34:25.706 25167-25200 BluetoothAdapter        com.gtdvm.echopoint                  I  STATE_ON
2024-06-17 22:34:25.708 25167-25200 BluetoothAdapter        com.gtdvm.echopoint                  I  STATE_ON
2024-06-17 22:34:25.709 25167-25200 BluetoothLeScanner      com.gtdvm.echopoint                  D  Start Scan with callback
2024-06-17 22:34:25.712  4926-5893  BtGatt.GattService      com.android.bluetooth                E  App 'com.gtdvm.echopoint' is scanning too frequently
2024-06-17 22:34:25.713 25167-25191 BluetoothLeScanner      com.gtdvm.echopoint                  D  onScannerRegistered() - status=6 scannerId=-1 mScannerId=0
2024-06-17 22:34:26.307 25167-25188 System                  com.gtdvm.echopoint                  W  A resource failed to call close. 
2024-06-17 22:34:26.307 25167-25188 System                  com.gtdvm.echopoint                  W  A resource failed to call close. 
 I found on the internet a recommendation from Android 12 and above to do with foreground service. with job scan if i want continuous scan is not supported by google.  I did, but I'm stuck, I don't understand how to get the altbeacon library to work correctly with the foreground service, because I have to constantly scan (at least I tried to do with the foreground service ). I feel like I didn't do well. I am leaving below the code from the foreground service and the class that I have all the scanning functions from altbeacon and please let me know if I have done something right and how I need to do it right. or a link to the documentation/tutorial/guide where it explains how to do the foreground service correctly. code with the foreground service:  package com.gtdvm.echopoint

import android.app.Notification
import android.app.Service
import android.content.Intent
//import android.os.Build
import android.os.IBinder
import android.app.NotificationChannel
import android.app.NotificationManager
import android.content.Context
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.NotificationCompat
//import androidx.core.app.NotificationManagerCompat


class ScanBeaconService : Service() {
private lateinit var appContext: Context
    private lateinit var bluetoothServices: BluetoothServices

    override fun onCreate() {
        super.onCreate()
        appContext = this.applicationContext
        bluetoothServices = BluetoothServices(appContext as AppCompatActivity)
        createNotificationChannel()
        val notification = createNotification()
        startForeground(NOTIFICATION_ID, notification)
    }

    override fun onBind(intent: Intent): IBinder? {
        //TODO("Return the communication channel to the service.")
        return null
    }

    override fun onDestroy() {
        super.onDestroy()
        bluetoothServices.stopScan()
        stopForeground(STOP_FOREGROUND_REMOVE)
    }

    private fun createNotificationChannel(){
//if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1){
val channel = NotificationChannel(NOTIFICATIONCHANNEL_ID, "Beacon Scan Service Channel", NotificationManager.IMPORTANCE_DEFAULT)
    .apply { description = "Channel for Beacon Scan Service" }
    val notificationManager: NotificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
notificationManager.createNotificationChannel(channel)
//}
    }

    private fun createNotification(): Notification {
return NotificationCompat.Builder(this, NOTIFICATIONCHANNEL_ID)
    .setContentTitle("Scanning for Beacons")
    .setContentText("The service is scanning for beacons in the background.")
    .setSmallIcon(R.drawable.ic_launcher_foreground)
    .setPriority(NotificationCompat.PRIORITY_DEFAULT)
    .setCategory(NotificationCompat.CATEGORY_SERVICE)
    .build()
    }

    fun stopService(){
        stopForeground(STOP_FOREGROUND_REMOVE)
        stopSelf()
    }

    companion object{
        private const val NOTIFICATIONCHANNEL_ID = "Echo_point_scan_service"
        private const val NOTIFICATION_ID = 1
    }

}

  function class from altbeacon:  package com.gtdvm.echopoint

import android.annotation.SuppressLint
import android.app.Activity
import android.bluetooth.BluetoothAdapter
import android.bluetooth.BluetoothDevice
import android.bluetooth.BluetoothGatt
import android.bluetooth.BluetoothGattCallback
import android.bluetooth.BluetoothManager
import android.bluetooth.le.ScanCallback
import android.bluetooth.BluetoothGattService
import android.bluetooth.BluetoothGattCharacteristic
import android.bluetooth.BluetoothGattCharacteristic.PERMISSION_READ
import android.bluetooth.BluetoothGattCharacteristic.PERMISSION_WRITE
import android.bluetooth.BluetoothGattCharacteristic.PROPERTY_WRITE
import android.bluetooth.BluetoothGattCharacteristic.PROPERTY_NOTIFY
import android.bluetooth.BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT
import android.bluetooth.BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE
import android.bluetooth.BluetoothGattDescriptor
import com.polidea.rxandroidble3.RxBleClient
import com.polidea.rxandroidble3.RxBleConnection
import com.polidea.rxandroidble3.RxBleDevice
import com.polidea.rxandroidble3.RxBleDeviceServices
import com.polidea.rxandroidble3.scan.ScanSettings
import com.polidea.rxandroidble3.scan.ScanFilter
import com.polidea.rxandroidble3.scan.ScanResult
import com.polidea.rxandroidble3.RxBleScanResult
import com.polidea.rxandroidble3.exceptions.BleException
import com.polidea.rxandroidble3.exceptions.BleDisconnectedException
import com.polidea.rxandroidble3.NotificationSetupMode
import com.polidea.rxandroidble3.RxBleConnection.RxBleConnectionState
import android.location.LocationManager
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.content.pm.PackageManager
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import android.content.Context
import android.content.ServiceConnection
import android.icu.number.IntegerWidth
import android.os.Build
import android.os.Looper
import android.os.ParcelUuid
import android.os.RemoteException
import android.provider.Settings
import android.util.Log
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.animation.defaultDecayAnimationSpec
import androidx.compose.ui.res.integerResource
import androidx.compose.ui.res.stringArrayResource
import androidx.lifecycle.ViewModelProvider
import io.reactivex.rxjava3.disposables.Disposable
import io.reactivex.rxjava3.core.Completable
import io.reactivex.rxjava3.core.Observable
import io.reactivex.rxjava3.core.Single
import io.reactivex.rxjava3.core.SingleSource
import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.internal.operators.observable.ObservableIgnoreElementsCompletable
import io.reactivex.rxjava3.internal.operators.observable.ObservableJust
import io.reactivex.rxjava3.internal.operators.observable.ObservableScan
import io.reactivex.rxjava3.schedulers.Schedulers
import kotlinx.coroutines.newFixedThreadPoolContext
import java.lang.StringBuilder
import java.nio.ByteBuffer
import java.util.UUID
//import com.gtdvm.echopoint.Utils.getMajor
//import com.gtdvm.echopoint.Utils.getMinor
//import com.gtdvm.echopoint.Utils.getUUID
import org.altbeacon.beacon.BeaconManager
import org.altbeacon.beacon.BeaconParser
import org.altbeacon.beacon.MonitorNotifier
import org.altbeacon.beacon.RangeNotifier
import org.altbeacon.beacon.Region
import org.altbeacon.beacon.*


//import android.window.OnBackInvokedCallback
//import android.window.OnBackInvokedDispatcher
//import androidx.activity.OnBackPressedCallback

//import androidx.core.app.ComponentActivity
//import androidx.activity.result.ActivityResultLauncher
//import androidx.activity.result.ActivityResult
//import androidx.activity.result.ActivityResultCallback
//import android.Manifest

class BluetoothServices(private val activity: AppCompatActivity): RangeNotifier, MonitorNotifier {
    private var managerDevices: ManagerDevices = ManagerDevices(activity)
    private var beaconManager: BeaconManager = BeaconManager.getInstanceForApplication(activity)
    private var rxBleClient: RxBleClient = RxBleClient.create(activity)
    var currentBleConnection: RxBleConnection? = null
    private var selectedRxBleDeviceClient: RxBleDevice? = null
    private var scanDisposable: Disposable? = null
    private var connectionDisposable: Disposable? = null
    //private val compositeDisposable = CompositeDisposable()
    private var personalBleService: BluetoothGattService? = null
    private var notificationCaracteristic: BluetoothGattCharacteristic? = null
    private var writeCaracteristic: BluetoothGattCharacteristic? = null
    private var descriptorBLE2902: BluetoothGattDescriptor? = null
   private val devicesFound = mutableListOf<IBeacon>()

    private val bleUUID = "A134D0B2-1DA2-1BA7-C94C-E8E00C9F7A2D" //"2D7A9F0C-E0E8-4CC9-A71B-A21DB2D034A1"
    private val servicesUUID = "6E400001-B5A3-F393-E0A9-E50E24DCCA9E"
    private val writeCharacteristicUUID = "6E400002-B5A3-F393-E0A9-E50E24DCCA9E"
    private val notificationUUID = "6E400003-B5A3-F393-E0A9-E50E24DCCA9E"
    private val descriptorBLE2902UUID = "00002902-0000-1000-8000-00805f9b34fb"


    private val notificationViewNodel: NotificationViewModel by lazy { ViewModelProvider(activity)[NotificationViewModel::class.java] }
    private val iBeaconsView: IBeaconsView by lazy { ViewModelProvider(activity)[IBeaconsView::class.java] }
    private val myIBeaconsRegion: Region = Region("myUniqueBeaconRegion", Identifier.parse(bleUUID), null, null)

    init {
        beaconManager.beaconParsers.add(BeaconParser(bleUUID).setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"))
beaconManager.foregroundScanPeriod = 1100L
        beaconManager.foregroundBetweenScanPeriod = 0L
beaconManager.setEnableScheduledScanJobs(false)
        beaconManager.enableForegroundServiceScanning()
        beaconManager.addMonitorNotifier(this)
        beaconManager.addRangeNotifier(this)
    }



    @SuppressLint("CheckResult")
    fun connectToDevice (deviceMacAddres: String){
        //notificationViewNodel.showNotificationData("connecting...")
       selectedRxBleDeviceClient = rxBleClient.getBleDevice(deviceMacAddres)
        connectionDisposable?.dispose()
          connectionDisposable = selectedRxBleDeviceClient?.establishConnection(false)
              ?.subscribe({ result ->
                  currentBleConnection = result
                  notificationViewNodel.showNotificationData(activity.getString(R.string.Message_After_Connecting))
                  result.discoverBleServices()
                      .subscribe({service ->
                          if (service.uuid == UUID.fromString(servicesUUID)){
                              personalBleService = service
                              result.enableNotificationCharacteristic()
                                  ?.subscribe({ resultData ->
                                      notificationViewNodel.showNotificationData(resultData.decodeToString())
                                  }, {

                                  })
                          }
                      },{

                      })
              },{

              })
    }

    private fun RxBleConnection.discoverBleServices (): Observable<BluetoothGattService> {
        return this.discoverServices()
                .toObservable()
                .flatMap{services ->
                    val myBleServices = services.bluetoothGattServices.find { it.uuid == UUID.fromString(servicesUUID) }
                    if (myBleServices != null) {
                        discoveryCharacteristics(myBleServices)
                            .flatMap { characteristics ->
                                when (characteristics.uuid) {
                                    UUID.fromString(notificationUUID) -> {
                                        notificationCaracteristic = characteristics
                                        Log.d("FINDING_CARACTERISTIC", "notification caracteristic are uuid: $notificationCaracteristic.uuid, property: $notificationCaracteristic.properties, permission: $notificationCaracteristic.permissions")
                                        notificationCaracteristic?.let {descriptorBLE2902 = it.getDescriptor(UUID.fromString(descriptorBLE2902UUID))}
                                    }
                                    UUID.fromString(writeCharacteristicUUID) -> {
                                        writeCaracteristic = characteristics
                                        Log.d("FINDING_CHARACTERISTIC", "write caracteristic are uuid: $writeCaracteristic.uuid, permission: $writeCaracteristic.permissions, properties: $writeCaracteristic.properties")
                                    }
                                }
                                Observable.just(myBleServices)
                            }
                    } else {
                        Observable.error(Throwable("serviciu cu uuid specificat nu afost gasit"))
                    }
                }
    }

    private fun discoveryCharacteristics (service: BluetoothGattService): Observable<BluetoothGattCharacteristic> {
        return Observable.fromIterable(service.characteristics)
    }

    @SuppressLint("CheckResult")
    fun writeBleCharacteristic (connection: RxBleConnection, sendingData: ByteArray) {
        try {
            Log.e("WRITE-CHARACTERISTIC", "function de scrierea characteristic sa apelat ")
            if (writeCaracteristic != null && writeCaracteristic!!.uuid == UUID.fromString(writeCharacteristicUUID)){
                val pew = writeCaracteristic!!.permissions// and
                val prw = writeCaracteristic!!.properties// and PROPERTY_WRITE
                val ptw = writeCaracteristic!!.writeType
                Log.e("CARACTERISTIC_PERMISSION", "caracteristica are permission $pew , properties :$prw, type: $ptw ")
                Log.e("VALUE", "property: $PROPERTY_WRITE, permission: $PERMISSION_WRITE")
                if ( prw == PROPERTY_WRITE){
                    Log.e("WRITE-CHARACTERISTIC", "caracteristica are aces sa scrie ")
                    when (ptw){
                        WRITE_TYPE_DEFAULT -> {
                            writeCaracteristic!!.writeType = WRITE_TYPE_DEFAULT
                            Log.e("WRITE_MDE", "set write mode default")
                        }
                        WRITE_TYPE_NO_RESPONSE ->{
                            writeCaracteristic!!.writeType = WRITE_TYPE_NO_RESPONSE
                            Log.e("WRITE_MODE", "no response write mode has been set")
                        }
                    }
                    connection.writeCharacteristic(writeCaracteristic!!, sendingData)
                        .subscribe({sucesedValue ->
                            if (sucesedValue.isNotEmpty()){
                                Log.e("WRITE-CHARACTERISTIC", "the writing feature confirmed with: ${sucesedValue.decodeToString()}")
                            }
                        },{throwable ->
//if (throwable is RxB){

//}
                        })
                } else{
                    Log.e("ERROR", "Caracteristica nu poate fii scrisa")
                }
            } else{
                Log.e("ERROR", "nu sa găsit caracteristica cu uuid specificat")
            }
        } catch (e: Exception){
            Log.e("EXCEPTION", "$e")
        }
    }

   @SuppressLint("CheckResult")
   private fun RxBleConnection.enableNotificationCharacteristic (): Observable<ByteArray>? {
        Log.e("NOTIFICATION-CHARACTERISTIC", "the notify function was called")
                 return if (notificationCaracteristic != null && notificationCaracteristic?.uuid == UUID.fromString(notificationUUID)){
                     Log.e("NOTIFICATION-CHARACTERISTIC", "caracteristica nu este null")
                    val prn = notificationCaracteristic!!.properties and PROPERTY_NOTIFY
                     val pen = notificationCaracteristic!!.permissions and PERMISSION_READ
                     Log.d("INFORMATION_CHARACTERISTIC", "propriety: $prn permission: $pen")
               if (prn == PROPERTY_NOTIFY){
                   Log.d("MESSAGE", "are permissions for notification")
                                               this.setupNotification(notificationCaracteristic!!)
                             .flatMap{notificationObservable ->
                                 if (!this.isEnabledDescriptor2902()){
                                     Log.d("DESCRIPTOR_STATUS", "descriptor status is disabled")
                                     this.writeDescriptor(descriptorBLE2902!!, BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE)
                                         .subscribe({
                                             Log.d("WRITE_DESCRIPTOR_STATUS", "descriptor was written successfully")
                                         },{
                                             Log.d("WRITE_DESCRIPTOR_STATUS", "an error occurred when writing the descriptor")
                                         })
                                 }
                                 notificationObservable}
               } else{
                   Log.d("ERROR", "cannot permissions for notification")
                   Observable.error(Throwable("caracteristica de notification nu se citeste sau de activat notification"))
               }
           } else{
                Observable.error(Throwable("caracteristica cu UUID specificat nu afost găsit sau este null"))
            }
    }

    private fun RxBleConnection.isEnabledDescriptor2902(): Boolean{
       descriptorBLE2902.let {
              val descriptor2902 = this.readDescriptor(descriptorBLE2902!!)
          return descriptor2902?.equals(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE) ?: false
        }
    }

    fun disConnect (){
        try {
            connectionDisposable?.dispose()
            currentBleConnection?.let {
                currentBleConnection = null
                             //compositeDisposable.dispose()
            }
        } catch (error: Exception){
            Log.e("DISCONNECT_ERROR", "eroarea este: $error.message")
        }
    }

    override fun didRangeBeaconsInRegion(beacons: MutableCollection<Beacon>?, region: Region?) {
beacons?.forEach{beacon ->
if (isPointer(beacon.id1)){
val iBeacon = IBeacon(beacon.bluetoothAddress)
    iBeacon.uuid = beacon.id1.toString()
    iBeacon.major = beacon.id2.toInt()
    iBeacon.minor = beacon.id3.toInt()
    iBeacon.rssi = beacon.rssi
    iBeacon.manufacturer = beacon.manufacturer.toString()
    devicesFound.add(iBeacon)
    iBeaconsView.updateListIBeacons(devicesFound)
}
}
    }


    override fun didEnterRegion(region: Region?) {

    }

    override fun didExitRegion(region: Region?) {
        if (devicesFound.any { it.macAddress == region?.bluetoothAddress }){
this.removeDeviceOfList(region?.bluetoothAddress)
iBeaconsView.updateListIBeacons(devicesFound)
        }
    }

    override fun didDetermineStateForRegion(state: Int, region: Region?) {
when (state) {
MonitorNotifier.INSIDE -> Log.d("BeaconMonitoring", "Inside region: ${region?.uniqueId}")
    MonitorNotifier.OUTSIDE -> Log.d("BeaconMonitoring", "Outside region: ${region?.uniqueId}")
}
    }


    fun startBluetoothScan () {
                     if (managerDevices.areBluetoothPermissionsGranted() && managerDevices.isBluetoothEnabled() && managerDevices.isLocationActive()) {


                    try {
                        beaconManager.startMonitoring(myIBeaconsRegion)
                        beaconManager.startRangingBeacons(myIBeaconsRegion)
                    } catch (e: RemoteException){
e.printStackTrace()
                        //emiter.onError(e)
                    }
//return devicesFound
            }
        }

    fun stopScan () {
        scanDisposable?.dispose()
        //val region = Region("myRangingUniqueId", null, null, null)
        try {
            beaconManager.stopMonitoring(myIBeaconsRegion)
            beaconManager.stopRangingBeacons(myIBeaconsRegion)
        } catch (e: RemoteException){
e.printStackTrace()
        }
        stopService()
    }

    private fun isPointer(deviceUUID: Identifier): Boolean {
        return deviceUUID.toString().equals(bleUUID, ignoreCase = true)
    }

    private fun removeDeviceOfList(deviceMacAddres: String?){
        devicesFound.forEachIndexed { index, iBeacon ->
            if (iBeacon.macAddress == deviceMacAddres){
                devicesFound.removeAt(index)
                return@forEachIndexed
            }
        }
    }

    fun startScanService(){
        val serviceIntent = Intent(activity, ScanBeaconService::class.java)
        activity.startForegroundService(serviceIntent)
    }

   private fun stopService(){
        val serviceIntent = Intent(activity, ScanBeaconService::class.java)
        activity.stopService(serviceIntent)
    }


}

  I also leave the permissions in the manifest file: <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" >

    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
    <uses-permission
        android:name="android.permission.BLUETOOTH_SCAN"
        android:usesPermissionFlags="neverForLocation"
        tools:targetApi="s" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />

    <uses-feature
        android:name="android.hardware.bluetooth"
        android:required="true" />
    <uses-feature
        android:name="android.hardware.bluetooth_le"
        android:required="true" />

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />

    <application
        android:allowBackup="true"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:enableOnBackInvokedCallback="true"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.EchoPoint"
        tools:targetApi="tiramisu" >
        <service
            android:name=".ScanBeaconService"
            android:enabled="true"
            android:foregroundServiceType="location"
            android:permission="android.permission.BIND_JOB_SERVICE" >
        </service>

        <activity
            android:name=".ScanAndCommunicationSelectedDevice"
            android:exported="false" />
        <activity
            android:name=".CommunicationWithTheDevice"
            android:exported="false" />
        <activity
            android:name=".ListDevices"
            android:exported="false" />
        <activity
            android:name=".UnderCategory"
            android:exported="false"
            android:label="@string/title_activity_under_category"
            android:theme="@style/Theme.EchoPoint.NoActionBar" />
        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:theme="@style/Theme.EchoPoint" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <service
            android:name="org.altbeacon.beacon.service.ScanJob"
            android:permission="android.permission.BIND_JOB_SERVICE" />

        <meta-data
            android:name="android.app.job.JobScheduler.SCHEDULE_IMMEDIATE"
            android:value="true" />
    </application>

</manifest>   please help me to get out of this impasse/problem.

@VolodaUa
Copy link
Contributor

VolodaUa commented Jul 2, 2024

Hi @G-Roman1988

You don't need your foreground service. The library already declared everthing and you just need to build notification, notification channel, grant notification permission(if I'm not mistaken).

This code starts the foreground service.
beaconManager.enableForegroundServiceScanning(builder.build(), 456)
beaconManager.setEnableScheduledScanJobs(false)

ForegroundService -> https://altbeacon.github.io/android-beacon-library/foreground-service.html

If you need to have BLE comunications with BLE device when the beacons are found:

  1. Clean up your code, remove all extra logic.
  2. Create your own foreground service, start this service.

val builder = Notification.Builder(this)
....
3) Configure BeaconManager
Notificaiton notification = builder.build(),
beaconManager.enableForegroundServiceScanning(notification ), 456)
beaconManager.setEnableScheduledScanJobs(false)

In your service -> startForeground() with the same notification id and notification.

So, you will foregound service scanning in library and your own.
Your foreground service type should be location if you want to have it worked for a long time

  1. Start monitoring and I suggest to call "requestStateForRegion()" to get the determinate state callbacl.
  2. I also suggest startiing ranging when you enetered in the region(Monitori notifier). Do in both "didDeterminateState" and "didEntered".
  3. Once you get it worked, proceed with connection and read characteristics.

Side notes:

override fun onCreate() {
super.onCreate()
appContext = this.applicationContext
bluetoothServices = BluetoothServices(appContext as AppCompatActivity)

It looks strange and not sure that it can work - cast applicationContext to Activity.

@G-Roman1988
Copy link
Author

Hello @VolodaUa! I dropped the personal foreground service and set altbeacon to use its own foreground service, which is declared. I created the channel for notification and notification but it doesn't work and the notification doesn't show either. to app info on notification is not active to allow notifications. on this link : https://altbeacon.github.io/android-beacon-library/foreground-service.html there is some information but i am new to android and i don't understand much there. I am leaving the code below modified and please help me out of this deadlock. package com.gtdvm.echopoint

import android.annotation.SuppressLint
import android.app.Activity
import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.os.IBinder
import android.app.Service
import android.bluetooth.BluetoothAdapter
import android.bluetooth.BluetoothDevice
import android.bluetooth.BluetoothGatt
import android.bluetooth.BluetoothGattCallback
import android.bluetooth.BluetoothManager
import android.bluetooth.le.ScanCallback
import android.bluetooth.BluetoothGattService
import android.bluetooth.BluetoothGattCharacteristic
import android.bluetooth.BluetoothGattCharacteristic.PERMISSION_READ
import android.bluetooth.BluetoothGattCharacteristic.PERMISSION_WRITE
import android.bluetooth.BluetoothGattCharacteristic.PROPERTY_WRITE
import android.bluetooth.BluetoothGattCharacteristic.PROPERTY_NOTIFY
import android.bluetooth.BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT
import android.bluetooth.BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE
import android.bluetooth.BluetoothGattDescriptor
import com.polidea.rxandroidble3.RxBleClient
import com.polidea.rxandroidble3.RxBleConnection
import com.polidea.rxandroidble3.RxBleDevice
import com.polidea.rxandroidble3.RxBleDeviceServices
import com.polidea.rxandroidble3.scan.ScanSettings
import com.polidea.rxandroidble3.scan.ScanFilter
import com.polidea.rxandroidble3.scan.ScanResult
import com.polidea.rxandroidble3.RxBleScanResult
import com.polidea.rxandroidble3.exceptions.BleException
import com.polidea.rxandroidble3.exceptions.BleDisconnectedException
import com.polidea.rxandroidble3.NotificationSetupMode
import com.polidea.rxandroidble3.RxBleConnection.RxBleConnectionState
import android.location.LocationManager
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.content.pm.PackageManager
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import android.content.Context
import android.content.ServiceConnection
import android.icu.number.IntegerWidth
import android.os.Build
import android.os.Looper
import android.os.ParcelUuid
import android.os.RemoteException
import android.provider.Settings
import android.util.Log
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.animation.defaultDecayAnimationSpec
import androidx.compose.ui.res.integerResource
import androidx.compose.ui.res.stringArrayResource
import androidx.core.app.NotificationCompat
import androidx.lifecycle.ViewModelProvider
import io.reactivex.rxjava3.disposables.Disposable
import io.reactivex.rxjava3.core.Completable
import io.reactivex.rxjava3.core.Observable
import io.reactivex.rxjava3.core.Single
import io.reactivex.rxjava3.core.SingleSource
import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.internal.operators.observable.ObservableIgnoreElementsCompletable
import io.reactivex.rxjava3.internal.operators.observable.ObservableJust
import io.reactivex.rxjava3.internal.operators.observable.ObservableScan
import io.reactivex.rxjava3.schedulers.Schedulers
import kotlinx.coroutines.newFixedThreadPoolContext
import java.lang.StringBuilder
import java.nio.ByteBuffer
import java.util.UUID
//import com.gtdvm.echopoint.Utils.getMajor
//import com.gtdvm.echopoint.Utils.getMinor
//import com.gtdvm.echopoint.Utils.getUUID
import org.altbeacon.beacon.BeaconManager
import org.altbeacon.beacon.BeaconParser
import org.altbeacon.beacon.MonitorNotifier
import org.altbeacon.beacon.RangeNotifier
import org.altbeacon.beacon.Region
import org.altbeacon.beacon.*

//import android.window.OnBackInvokedCallback
//import android.window.OnBackInvokedDispatcher
//import androidx.activity.OnBackPressedCallback

//import androidx.core.app.ComponentActivity
//import androidx.activity.result.ActivityResultLauncher
//import androidx.activity.result.ActivityResult
//import androidx.activity.result.ActivityResultCallback
//import android.Manifest

class BluetoothServices(private val activity: AppCompatActivity): RangeNotifier, MonitorNotifier {
private var managerDevices: ManagerDevices = ManagerDevices(activity)
private var beaconManager: BeaconManager = BeaconManager.getInstanceForApplication(activity)
private var rxBleClient: RxBleClient = RxBleClient.create(activity)
var currentBleConnection: RxBleConnection? = null
private var selectedRxBleDeviceClient: RxBleDevice? = null
private var scanDisposable: Disposable? = null
private var connectionDisposable: Disposable? = null
//private val compositeDisposable = CompositeDisposable()
private var personalBleService: BluetoothGattService? = null
private var notificationCaracteristic: BluetoothGattCharacteristic? = null
private var writeCaracteristic: BluetoothGattCharacteristic? = null
private var descriptorBLE2902: BluetoothGattDescriptor? = null
private val devicesFound = mutableListOf()

private val bleUUID = "A134D0B2-1DA2-1BA7-C94C-E8E00C9F7A2D" //"2D7A9F0C-E0E8-4CC9-A71B-A21DB2D034A1"
private val servicesUUID = "6E400001-B5A3-F393-E0A9-E50E24DCCA9E"
private val writeCharacteristicUUID = "6E400002-B5A3-F393-E0A9-E50E24DCCA9E"
private val notificationUUID = "6E400003-B5A3-F393-E0A9-E50E24DCCA9E"
private val descriptorBLE2902UUID = "00002902-0000-1000-8000-00805f9b34fb"


private val notificationViewNodel: NotificationViewModel by lazy { ViewModelProvider(activity)[NotificationViewModel::class.java] }
private val iBeaconsView: IBeaconsView by lazy { ViewModelProvider(activity)[IBeaconsView::class.java] }
private val myIBeaconsRegion: Region = Region("myUniqueBeaconRegion", Identifier.parse(bleUUID), null, null)

init {
    beaconManager.beaconParsers.add(BeaconParser(bleUUID).setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"))

createNotificationChannel()

    beaconManager.foregroundScanPeriod = 1100L
    beaconManager.foregroundBetweenScanPeriod = 0L

beaconManager.setEnableScheduledScanJobs(false)
beaconManager.enableForegroundServiceScanning(createNotification(), NOTIFICATION_ID)
beaconManager.addMonitorNotifier(this)
beaconManager.addRangeNotifier(this)
}

@SuppressLint("CheckResult")
fun connectToDevice (deviceMacAddres: String){
    //notificationViewNodel.showNotificationData("connecting...")
   selectedRxBleDeviceClient = rxBleClient.getBleDevice(deviceMacAddres)
    connectionDisposable?.dispose()
      connectionDisposable = selectedRxBleDeviceClient?.establishConnection(false)
          ?.subscribe({ result ->
              currentBleConnection = result
              notificationViewNodel.showNotificationData(activity.getString(R.string.Message_After_Connecting))
              result.discoverBleServices()
                  .subscribe({service ->
                      if (service.uuid == UUID.fromString(servicesUUID)){
                          personalBleService = service
                          result.enableNotificationCharacteristic()
                              ?.subscribe({ resultData ->
                                  notificationViewNodel.showNotificationData(resultData.decodeToString())
                              }, {

                              })
                      }
                  },{

                  })
          },{

          })
}

private fun RxBleConnection.discoverBleServices (): Observable<BluetoothGattService> {
    return this.discoverServices()
            .toObservable()
            .flatMap{services ->
                val myBleServices = services.bluetoothGattServices.find { it.uuid == UUID.fromString(servicesUUID) }
                if (myBleServices != null) {
                    discoveryCharacteristics(myBleServices)
                        .flatMap { characteristics ->
                            when (characteristics.uuid) {
                                UUID.fromString(notificationUUID) -> {
                                    notificationCaracteristic = characteristics
                                    Log.d("FINDING_CARACTERISTIC", "notification caracteristic are uuid: $notificationCaracteristic.uuid, property: $notificationCaracteristic.properties, permission: $notificationCaracteristic.permissions")
                                    notificationCaracteristic?.let {descriptorBLE2902 = it.getDescriptor(UUID.fromString(descriptorBLE2902UUID))}
                                }
                                UUID.fromString(writeCharacteristicUUID) -> {
                                    writeCaracteristic = characteristics
                                    Log.d("FINDING_CHARACTERISTIC", "write caracteristic are uuid: $writeCaracteristic.uuid, permission: $writeCaracteristic.permissions, properties: $writeCaracteristic.properties")
                                }
                            }
                            Observable.just(myBleServices)
                        }
                } else {
                    Observable.error(Throwable("serviciu cu uuid specificat nu afost gasit"))
                }
            }
}

private fun discoveryCharacteristics (service: BluetoothGattService): Observable<BluetoothGattCharacteristic> {
    return Observable.fromIterable(service.characteristics)
}

@SuppressLint("CheckResult")
fun writeBleCharacteristic (connection: RxBleConnection, sendingData: ByteArray) {
    try {
        Log.e("WRITE-CHARACTERISTIC", "function de scrierea characteristic sa apelat ")
        if (writeCaracteristic != null && writeCaracteristic!!.uuid == UUID.fromString(writeCharacteristicUUID)){
            val pew = writeCaracteristic!!.permissions// and
            val prw = writeCaracteristic!!.properties// and PROPERTY_WRITE
            val ptw = writeCaracteristic!!.writeType
            Log.e("CARACTERISTIC_PERMISSION", "caracteristica are permission $pew , properties :$prw, type: $ptw ")
            Log.e("VALUE", "property: $PROPERTY_WRITE, permission: $PERMISSION_WRITE")
            if ( prw == PROPERTY_WRITE){
                Log.e("WRITE-CHARACTERISTIC", "caracteristica are aces sa scrie ")
                when (ptw){
                    WRITE_TYPE_DEFAULT -> {
                        writeCaracteristic!!.writeType = WRITE_TYPE_DEFAULT
                        Log.e("WRITE_MDE", "set write mode default")
                    }
                    WRITE_TYPE_NO_RESPONSE ->{
                        writeCaracteristic!!.writeType = WRITE_TYPE_NO_RESPONSE
                        Log.e("WRITE_MODE", "no response write mode has been set")
                    }
                }
                connection.writeCharacteristic(writeCaracteristic!!, sendingData)
                    .subscribe({sucesedValue ->
                        if (sucesedValue.isNotEmpty()){
                            Log.e("WRITE-CHARACTERISTIC", "the writing feature confirmed with: ${sucesedValue.decodeToString()}")
                        }
                    },{throwable ->

//if (throwable is RxB){

//}
})
} else{
Log.e("ERROR", "Caracteristica nu poate fii scrisa")
}
} else{
Log.e("ERROR", "nu sa găsit caracteristica cu uuid specificat")
}
} catch (e: Exception){
Log.e("EXCEPTION", "$e")
}
}

@SuppressLint("CheckResult")
private fun RxBleConnection.enableNotificationCharacteristic (): Observable? {
Log.e("NOTIFICATION-CHARACTERISTIC", "the notify function was called")
return if (notificationCaracteristic != null && notificationCaracteristic?.uuid == UUID.fromString(notificationUUID)){
Log.e("NOTIFICATION-CHARACTERISTIC", "caracteristica nu este null")
val prn = notificationCaracteristic!!.properties and PROPERTY_NOTIFY
val pen = notificationCaracteristic!!.permissions and PERMISSION_READ
Log.d("INFORMATION_CHARACTERISTIC", "propriety: $prn permission: $pen")
if (prn == PROPERTY_NOTIFY){
Log.d("MESSAGE", "are permissions for notification")
this.setupNotification(notificationCaracteristic!!)
.flatMap{notificationObservable ->
if (!this.isEnabledDescriptor2902()){
Log.d("DESCRIPTOR_STATUS", "descriptor status is disabled")
this.writeDescriptor(descriptorBLE2902!!, BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE)
.subscribe({
Log.d("WRITE_DESCRIPTOR_STATUS", "descriptor was written successfully")
},{
Log.d("WRITE_DESCRIPTOR_STATUS", "an error occurred when writing the descriptor")
})
}
notificationObservable}
} else{
Log.d("ERROR", "cannot permissions for notification")
Observable.error(Throwable("caracteristica de notification nu se citeste sau de activat notification"))
}
} else{
Observable.error(Throwable("caracteristica cu UUID specificat nu afost găsit sau este null"))
}
}

private fun RxBleConnection.isEnabledDescriptor2902(): Boolean{
   descriptorBLE2902.let {
          val descriptor2902 = this.readDescriptor(descriptorBLE2902!!)
      return descriptor2902?.equals(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE) ?: false
    }
}

fun disConnect (){
    try {
        connectionDisposable?.dispose()
        currentBleConnection?.let {
            currentBleConnection = null
                         //compositeDisposable.dispose()
        }
    } catch (error: Exception){
        Log.e("DISCONNECT_ERROR", "eroarea este: $error.message")
    }
}

override fun didRangeBeaconsInRegion(beacons: MutableCollection<Beacon>?, region: Region?) {

beacons?.forEach{beacon ->
if (isPointer(beacon.id1)){
val iBeacon = IBeacon(beacon.bluetoothAddress)
iBeacon.uuid = beacon.id1.toString()
iBeacon.major = beacon.id2.toInt()
iBeacon.minor = beacon.id3.toInt()
iBeacon.rssi = beacon.rssi
iBeacon.manufacturer = beacon.manufacturer.toString()
devicesFound.add(iBeacon)
iBeaconsView.updateListIBeacons(devicesFound)
}
}
}

override fun didEnterRegion(region: Region?) {

}

override fun didExitRegion(region: Region?) {
    if (devicesFound.any { it.macAddress == region?.bluetoothAddress }){

this.removeDeviceOfList(region?.bluetoothAddress)
iBeaconsView.updateListIBeacons(devicesFound)
}
}

override fun didDetermineStateForRegion(state: Int, region: Region?) {

when (state) {
MonitorNotifier.INSIDE -> Log.d("BeaconMonitoring", "Inside region: ${region?.uniqueId}")
MonitorNotifier.OUTSIDE -> Log.d("BeaconMonitoring", "Outside region: ${region?.uniqueId}")
}
}

fun startBluetoothScan () {
                 if (managerDevices.areBluetoothPermissionsGranted() && managerDevices.isBluetoothEnabled() && managerDevices.isLocationActive()) {


                try {
                    beaconManager.startMonitoring(myIBeaconsRegion)
                    beaconManager.startRangingBeacons(myIBeaconsRegion)
                    beaconManager.requestStateForRegion(myIBeaconsRegion)
                } catch (e: RemoteException){

e.printStackTrace()
//emiter.onError(e)
}
//return devicesFound
}
}

fun stopScan () {
    scanDisposable?.dispose()
    //val region = Region("myRangingUniqueId", null, null, null)
    try {
        beaconManager.stopMonitoring(myIBeaconsRegion)
        beaconManager.stopRangingBeacons(myIBeaconsRegion)
    } catch (e: RemoteException){

e.printStackTrace()
}
}

private fun isPointer(deviceUUID: Identifier): Boolean {
    return deviceUUID.toString().equals(bleUUID, ignoreCase = true)
}

private fun removeDeviceOfList(deviceMacAddres: String?){
    devicesFound.forEachIndexed { index, iBeacon ->
        if (iBeacon.macAddress == deviceMacAddres){
            devicesFound.removeAt(index)
            return@forEachIndexed
        }
    }
}

private fun createNotificationChannel(){

Log.d("NOTIFICATION_CHANEL", "the create notification channel function was called")
//if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1){
val channel = NotificationChannel(NOTIFICATIONCHANNEL_ID, "Beacon Scan Service Channel", NotificationManager.IMPORTANCE_DEFAULT)
//.apply { description = "Channel for Beacon Scan Service" }
val notificationManager: NotificationManager = activity.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.createNotificationChannel(channel)
//}
}

private fun createNotification(): Notification {
    Log.d("CREATE_NOTIFICATION", "the notification has been created")
    //val notificationIntent = Intent(activity, MainActivity::class.java)
    //val pendingIntent = PendingIntent.getActivity(activity, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT)
    return NotificationCompat.Builder(activity, NOTIFICATIONCHANNEL_ID)
        .setContentTitle("Scanning for Beacons")
        .setContentText("The service is scanning for beacons in the background.")
        .setSmallIcon(R.drawable.ic_launcher_foreground)

// .setContentIntent(pendingIntent)
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
.setCategory(NotificationCompat.CATEGORY_SERVICE)
.build()
}

companion object{
    private const val NOTIFICATIONCHANNEL_ID = "Echo_point_scan_service"
    private const val NOTIFICATION_ID = 456
}

}

this is log after i modified with foreground service. 2024-07-08 07:03:35.953 12677-12677 BeaconManager com.gtdvm.echopoint I BeaconManager started up on pid 12677 named 'com.gtdvm.echopoint' for application package 'com.gtdvm.echopoint'. isMainProcess=true
2024-07-08 07:03:35.955 12677-12677 BeaconParser com.gtdvm.echopoint D Parsing beacon layout: m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25
2024-07-08 07:03:35.971 12677-12677 Compatibil...geReporter com.gtdvm.echopoint D Compat change id reported: 263076149; UID 10316; state: ENABLED
2024-07-08 07:03:35.975 12677-12677 BeaconParser com.gtdvm.echopoint D Parsing beacon layout: m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24
2024-07-08 07:03:35.976 12677-12677 NOTIFICATION_CHANEL com.gtdvm.echopoint D the create notification channel function was called
2024-07-08 07:03:35.976 12677-12677 BeaconManager com.gtdvm.echopoint W Disabling ScanJobs on Android 8+ may disable delivery of beacon callbacks in the background unless a foreground service is active.
2024-07-08 07:03:35.977 12677-12677 ScanJob com.gtdvm.echopoint I Using immediateScanJobId from manifest: 208352939
2024-07-08 07:03:35.978 12677-12677 ScanJob com.gtdvm.echopoint I Using periodicScanJobId from manifest: 208352940
2024-07-08 07:03:35.979 12677-12677 CREATE_NOTIFICATION com.gtdvm.echopoint D the notification has been created
2024-07-08 07:03:35.980 12677-12677 BeaconManager com.gtdvm.echopoint W Disabling ScanJobs on Android 8+ may disable delivery of beacon callbacks in the background unless a foreground service is active.
2024-07-08 07:03:35.981 12677-12677 ScanJob com.gtdvm.echopoint I Using immediateScanJobId from manifest: 208352939
2024-07-08 07:03:35.981 12677-12677 ScanJob com.gtdvm.echopoint I Using periodicScanJobId from manifest: 208352940
2024-07-08 07:03:35.999 12677-12677 LOCATION-MANAGER com.gtdvm.echopoint D locationManager is : true
2024-07-08 07:03:36.002 12677-12677 BackgroundPowerSaver com.gtdvm.echopoint I Background mode not set. We assume we are in the foreground.
2024-07-08 07:03:36.002 12677-12677 BeaconManager com.gtdvm.echopoint I Attempting to starting foreground beacon scanning service.
2024-07-08 07:03:36.004 12677-12677 BeaconManager com.gtdvm.echopoint I successfully started foreground beacon scanning service.
2024-07-08 07:03:36.006 12677-12677 BeaconMonitoring com.gtdvm.echopoint D Outside region: myUniqueBeaconRegion
2024-07-08 07:03:36.009 12677-12677 ContentCaptureHelper com.gtdvm.echopoint I Setting logging level to OFF
2024-07-08 07:03:36.024 12677-12677 CycledLeScanner com.gtdvm.echopoint I Using Android O scanner
2024-07-08 07:03:36.026 12677-12677 ScanHelper com.gtdvm.echopoint D BeaconParsers set to count: 0
2024-07-08 07:03:36.026 12677-12677 BeaconService com.gtdvm.echopoint I beaconService version 2.20.6 is starting up on the main process
2024-07-08 07:03:36.039 12677-12677 ModelSpeci...Calculator com.gtdvm.echopoint W Cannot find match for this device. Using default
2024-07-08 07:03:36.039 12677-12677 ModelSpeci...Calculator com.gtdvm.echopoint W Cannot find match for this device. Using default
2024-07-08 07:03:36.039 12677-12677 BeaconService com.gtdvm.echopoint I starting with intent Intent { cmp=com.gtdvm.echopoint/org.altbeacon.beacon.service.BeaconService }
2024-07-08 07:03:36.039 12677-12677 BeaconService com.gtdvm.echopoint I binding
2024-07-08 07:03:36.069 12677-12677 BeaconMonitoring com.gtdvm.echopoint D Outside region: myUniqueBeaconRegion
2024-07-08 07:03:36.076 12677-12677 BeaconService com.gtdvm.echopoint I start ranging received
2024-07-08 07:03:36.077 12677-12953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-08 07:03:36.077 12677-12677 Compatibil...geReporter com.gtdvm.echopoint D Compat change id reported: 160794467; UID 10316; state: ENABLED
2024-07-08 07:03:36.078 12677-12677 BeaconService com.gtdvm.echopoint I start monitoring received
2024-07-08 07:03:36.079 12677-12917 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=2 mScannerId=0
2024-07-08 07:03:36.160 12677-12677 BeaconService com.gtdvm.echopoint I Received settings update
2024-07-08 07:03:36.566 12677-12677 VRI[MainActivity] com.gtdvm.echopoint D visibilityChanged oldVisibility=true newVisibility=false
2024-07-08 07:03:42.711 12677-12953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-08 07:03:42.725 12677-12953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-08 07:03:42.736 12677-12956 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=2 mScannerId=0
2024-07-08 07:03:49.365 12677-12953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-08 07:03:49.380 12677-12953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-08 07:03:49.390 12677-12917 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=2 mScannerId=0
2024-07-08 07:03:56.021 12677-12953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-08 07:03:56.037 12677-12953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-08 07:03:56.048 12677-12917 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=2 mScannerId=0
2024-07-08 07:04:02.660 12677-12953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-08 07:04:02.671 12677-12953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-08 07:04:02.683 12677-12917 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=2 mScannerId=0
2024-07-08 07:04:06.776 12677-12677 BeaconService com.gtdvm.echopoint I stop monitoring received
2024-07-08 07:04:06.779 12677-12677 CycledLeScanner com.gtdvm.echopoint I Adjusted scanStopTime to be 255195385
2024-07-08 07:04:06.779 12677-12677 BeaconService com.gtdvm.echopoint I stop ranging received
2024-07-08 07:04:06.780 12677-12953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-08 07:04:06.783 12677-12677 BeaconService com.gtdvm.echopoint I unbinding so destroying self
2024-07-08 07:04:06.784 12677-12953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-08 07:04:06.784 12677-12953 BluetoothLeScanner com.gtdvm.echopoint D could not find callback wrapper
2024-07-08 07:04:06.790 12677-12677 WindowOnBackDispatcher com.gtdvm.echopoint W sendCancelIfRunning: isInProgress=falsecallback=android.app.Activity$$ExternalSyntheticLambda0@436c42e
2024-07-08 07:04:06.796 12677-12677 BeaconService com.gtdvm.echopoint E onDestroy()
2024-07-08 07:04:06.796 12677-12677 BeaconService com.gtdvm.echopoint I onDestroy called. stopping scanning
2024-07-08 07:04:06.823 12677-12677 LOCATION-MANAGER com.gtdvm.echopoint D locationManager is : true
2024-07-08 07:04:06.829 12677-12677 ContentCaptureHelper com.gtdvm.echopoint I Setting logging level to OFF
2024-07-08 07:04:07.401 12677-12677 VRI[ListDevices] com.gtdvm.echopoint D visibilityChanged oldVisibility=true newVisibility=false
2024-07-08 07:04:07.416 12677-12677 WindowOnBackDispatcher com.gtdvm.echopoint W sendCancelIfRunning: isInProgress=falsecallback=androidx.activity.OnBackPressedDispatcher$Api34Impl$createOnBackAnimationCallback$1@c65e3f8
2024-07-08 07:04:07.422 12677-12677 WindowOnBackDispatcher com.gtdvm.echopoint W sendCancelIfRunning: isInProgress=falsecallback=android.app.Activity$$ExternalSyntheticLambda0@7273f5b
please help me with any idea.

@G-Roman1988
Copy link
Author

I solved it with the foreground service notification, when I start the scan, the notification also appears, but the beacon devices are not identified on android 12 and higher but on android 11, everything is fine. in the log, no changes, I see no errors or warnings.

@VolodaUa
Copy link
Contributor

Hi @G-Roman1988

I'll check once I have free time. Please attach the minimal reproducible project without the build folder. Just project folder.
It's difficult to help with hundreds of lines...

Before that, I would recommend you do the following now:

  1. Download this app:
    https://github.com/vhiribarren/beacon-simulator-android

Emulate your beacon using this app. Only iBeacon part!!!
2) Check if it works with this app.

beaconManager.foregroundScanPeriod = 1100L
beaconManager.foregroundBetweenScanPeriod = 0L
Additionally, I would recommend removing such lines and use default library settings.

@GurgenHOVH
Copy link

I had a similar issue and removing neverForLocation from BLUETOOTH_SCAN permission solved my issue.

@G-Roman1988
Copy link
Author

[Echopoint.zip](https://github.com/user-attachment Hello ! I have tried all your ideas with no success. I have attached code from the project zip file, maybe you can identify what the problem is and where. for me when i start scan the notification shows after a second and I don't know if that's good or not. I have this in my diary: 2024-07-24 12:34:07.085 6848-6848 BeaconManager com.gtdvm.echopoint I BeaconManager started up on pid 6848 named 'com.gtdvm.echopoint' for application package 'com.gtdvm.echopoint'. isMainProcess=true
2024-07-24 12:34:07.088 6848-6848 BeaconParser com.gtdvm.echopoint D Parsing beacon layout: m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25
2024-07-24 12:34:07.106 6848-6848 Compatibil...geReporter com.gtdvm.echopoint D Compat change id reported: 263076149; UID 10316; state: ENABLED
2024-07-24 12:34:07.111 6848-6848 BeaconParser com.gtdvm.echopoint D Parsing beacon layout: m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24
2024-07-24 12:34:07.111 6848-6848 NOTIFICATION_CHANEL com.gtdvm.echopoint D the create notification channel function was called
2024-07-24 12:34:07.112 6848-6848 BeaconManager com.gtdvm.echopoint W Disabling ScanJobs on Android 8+ may disable delivery of beacon callbacks in the background unless a foreground service is active.
2024-07-24 12:34:07.114 6848-6848 ScanJob com.gtdvm.echopoint I Using immediateScanJobId from manifest: 208352939
2024-07-24 12:34:07.114 6848-6848 ScanJob com.gtdvm.echopoint I Using periodicScanJobId from manifest: 208352940
2024-07-24 12:34:07.114 6848-6848 CREATE_NOTIFICATION com.gtdvm.echopoint D the notification has been created
2024-07-24 12:34:07.117 6848-6848 BeaconManager com.gtdvm.echopoint W Disabling ScanJobs on Android 8+ may disable delivery of beacon callbacks in the background unless a foreground service is active.
2024-07-24 12:34:07.117 6848-6848 ScanJob com.gtdvm.echopoint I Using immediateScanJobId from manifest: 208352939
2024-07-24 12:34:07.118 6848-6848 ScanJob com.gtdvm.echopoint I Using periodicScanJobId from manifest: 208352940
2024-07-24 12:34:07.135 6848-6848 LOCATION-MANAGER com.gtdvm.echopoint D locationManager is : true
2024-07-24 12:34:07.138 6848-6848 BackgroundPowerSaver com.gtdvm.echopoint I Background mode not set. We assume we are in the foreground.
2024-07-24 12:34:07.139 6848-6848 BeaconManager com.gtdvm.echopoint I Attempting to starting foreground beacon scanning service.
2024-07-24 12:34:07.146 6848-6848 BeaconManager com.gtdvm.echopoint I successfully started foreground beacon scanning service.
2024-07-24 12:34:07.148 6848-6848 BeaconMonitoring com.gtdvm.echopoint D Outside region: myUniqueBeaconRegion
2024-07-24 12:34:07.152 6848-6848 ContentCaptureHelper com.gtdvm.echopoint I Setting logging level to OFF
2024-07-24 12:34:07.166 6848-6848 CycledLeScanner com.gtdvm.echopoint I Using Android O scanner
2024-07-24 12:34:07.167 6848-6848 ScanHelper com.gtdvm.echopoint D BeaconParsers set to count: 0
2024-07-24 12:34:07.167 6848-6848 BeaconService com.gtdvm.echopoint I beaconService version 2.20.6 is starting up on the main process
2024-07-24 12:34:07.180 6848-6848 ModelSpeci...Calculator com.gtdvm.echopoint W Cannot find match for this device. Using default
2024-07-24 12:34:07.181 6848-6848 ModelSpeci...Calculator com.gtdvm.echopoint W Cannot find match for this device. Using default
2024-07-24 12:34:07.181 6848-6848 BeaconService com.gtdvm.echopoint I starting with intent Intent { cmp=com.gtdvm.echopoint/org.altbeacon.beacon.service.BeaconService }
2024-07-24 12:34:07.181 6848-6848 BeaconService com.gtdvm.echopoint I binding
2024-07-24 12:34:07.213 6848-6848 BeaconMonitoring com.gtdvm.echopoint D Outside region: myUniqueBeaconRegion
2024-07-24 12:34:07.220 6848-6848 BeaconService com.gtdvm.echopoint I start ranging received
2024-07-24 12:34:07.221 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:34:07.221 6848-6848 Compatibil...geReporter com.gtdvm.echopoint D Compat change id reported: 160794467; UID 10316; state: ENABLED
2024-07-24 12:34:07.222 6848-6848 BeaconService com.gtdvm.echopoint I start monitoring received
2024-07-24 12:34:07.226 6848-6865 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=2 mScannerId=0
2024-07-24 12:34:07.304 6848-6848 BeaconService com.gtdvm.echopoint I Received settings update
2024-07-24 12:34:07.710 6848-6848 VRI[MainActivity] com.gtdvm.echopoint D visibilityChanged oldVisibility=true newVisibility=false
2024-07-24 12:34:11.761 6848-6857 gtdvm.echopoint com.gtdvm.echopoint I Background concurrent mark compact GC freed 37301(6565KB) AllocSpace objects, 1(20KB) LOS objects, 84% free, 4462KB/28MB, paused 394us,6.575ms total 54.323ms
2024-07-24 12:34:13.865 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:34:13.880 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:34:13.890 6848-6969 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=2 mScannerId=0
2024-07-24 12:34:20.514 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:34:20.533 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:34:20.543 6848-6969 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=2 mScannerId=0
2024-07-24 12:34:27.165 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:34:27.178 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:34:27.189 6848-6865 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=2 mScannerId=0
2024-07-24 12:34:33.811 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:34:33.830 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:34:33.840 6848-6969 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=2 mScannerId=0
2024-07-24 12:34:40.466 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:34:40.488 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:34:40.502 6848-6969 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=2 mScannerId=0
2024-07-24 12:34:47.126 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:34:47.149 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:34:47.159 6848-6865 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=2 mScannerId=0
2024-07-24 12:34:53.782 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:34:53.786 6848-6848 CycledLeSc...orLollipop com.gtdvm.echopoint E Scan failed: a BLE scan with the same settings is already started by the app
2024-07-24 12:35:00.450 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:35:00.473 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:35:00.483 6848-6865 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=2 mScannerId=0
2024-07-24 12:35:03.795 6848-6848 BeaconService com.gtdvm.echopoint I set scan intervals received
2024-07-24 12:35:03.806 6848-6848 VRI[ListDevices] com.gtdvm.echopoint D visibilityChanged oldVisibility=true newVisibility=false
2024-07-24 12:35:03.808 6848-6848 WindowOnBackDispatcher com.gtdvm.echopoint W sendCancelIfRunning: isInProgress=falsecallback=androidx.activity.OnBackPressedDispatcher$Api34Impl$createOnBackAnimationCallback$1@6844145
2024-07-24 12:35:04.887 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:35:04.907 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:35:04.915 6848-6956 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=1 mScannerId=0
2024-07-24 12:35:05.727 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:35:05.741 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:35:05.753 6848-6865 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=1 mScannerId=0
2024-07-24 12:35:15.744 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:35:15.760 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:35:15.770 6848-6865 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=1 mScannerId=0
2024-07-24 12:35:24.732 6848-6848 BeaconService com.gtdvm.echopoint I set scan intervals received
2024-07-24 12:35:24.749 6848-6848 CycledLeScanner com.gtdvm.echopoint I Adjusted nextScanStartTime to be Wed Jul 24 12:35:15 GMT+03:00 2024
2024-07-24 12:35:24.772 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:35:24.777 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:35:24.786 6848-6865 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=1 mScannerId=0
2024-07-24 12:35:31.408 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:35:31.416 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:35:31.426 6848-6956 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=1 mScannerId=0
2024-07-24 12:35:38.038 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:35:38.060 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:35:38.071 6848-6969 BluetoothLeScanner com.gtdvm.echopoint D onScannerRegistered() - status=0 scannerId=1 mScannerId=0
2024-07-24 12:35:42.156 6848-6848 BeaconService com.gtdvm.echopoint I stop monitoring received
2024-07-24 12:35:42.158 6848-6848 CycledLeScanner com.gtdvm.echopoint I Adjusted scanStopTime to be 967533421
2024-07-24 12:35:42.158 6848-6848 BeaconService com.gtdvm.echopoint I stop ranging received
2024-07-24 12:35:42.158 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:35:42.159 6848-6848 BeaconService com.gtdvm.echopoint I unbinding so destroying self
2024-07-24 12:35:42.164 6848-6953 BluetoothAdapter com.gtdvm.echopoint D isLeEnabled(): ON
2024-07-24 12:35:42.164 6848-6953 BluetoothLeScanner com.gtdvm.echopoint D could not find callback wrapper
2024-07-24 12:35:42.165 6848-6848 WindowOnBackDispatcher com.gtdvm.echopoint W sendCancelIfRunning: isInProgress=falsecallback=android.app.Activity$$ExternalSyntheticLambda0@abc6f10
2024-07-24 12:35:42.171 6848-6848 BeaconService com.gtdvm.echopoint E onDestroy()
2024-07-24 12:35:42.171 6848-6848 BeaconService com.gtdvm.echopoint I onDestroy called. stopping scanning
2024-07-24 12:35:42.199 6848-6848 LOCATION-MANAGER com.gtdvm.echopoint D locationManager is : true
2024-07-24 12:35:42.206 6848-6848 ContentCaptureHelper com.gtdvm.echopoint I Setting logging level to OFF
2024-07-24 12:35:42.778 6848-6848 VRI[ListDevices] com.gtdvm.echopoint D visibilityChanged oldVisibility=true newVisibility=false
2024-07-24 12:35:42.790 6848-6848 WindowOnBackDispatcher com.gtdvm.echopoint W sendCancelIfRunning: isInProgress=falsecallback=androidx.activity.OnBackPressedDispatcher$Api34Impl$createOnBackAnimationCallback$1@6844145
2024-07-24 12:35:42.796 6848-6848 WindowOnBackDispatcher com.gtdvm.echopoint W sendCancelIfRunning: isInProgress=falsecallback=android.app.Activity$$ExternalSyntheticLambda0@76cbdbc

@VolodaUa
Copy link
Contributor

@G-Roman1988 This file is not available.

@G-Roman1988
Copy link
Author

I'm attaching the file again and if it doesn't work I'll leave this link for download
Echopoint.zip
https://cloud.gtdvm.com/index.php/s/PiT9Zxt9we56ktk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants