Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d60616e authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix kotlin nullable errors in Bluetooth" into main am: 2ece3db0

parents 2639b5fc 2ece3db0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ class AndroidInternal(val context: Context) : AndroidImplBase(), Closeable {

    private val bluetoothManager = context.getSystemService(BluetoothManager::class.java)!!
    private val bluetoothAdapter = bluetoothManager.adapter
    private var telephonyManager = context.getSystemService(TelephonyManager::class.java)
    private var telephonyManager = context.getSystemService(TelephonyManager::class.java)!!
    private val DEFAULT_MESSAGE_LEN = 130
    private var device: UiDevice =
        UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
+4 −2
Original line number Diff line number Diff line
@@ -614,8 +614,10 @@ class Host(
                        override fun onScanResult(callbackType: Int, result: ScanResult) {
                            val bluetoothDevice = result.device
                            val scanRecord = result.scanRecord
                            checkNotNull(scanRecord)
                            val scanData = scanRecord.getAdvertisingDataMap()
                            val serviceData = scanRecord?.serviceData!!
                            val serviceData = scanRecord.serviceData
                            checkNotNull(serviceData)

                            var dataTypesBuilder =
                                DataTypes.newBuilder().setTxPowerLevel(scanRecord.getTxPowerLevel())
@@ -732,7 +734,7 @@ class Host(

                            // Flags DataTypes CSSv10 1.3 Flags
                            val mode: DiscoverabilityMode =
                                when (result.scanRecord.advertiseFlags and 0b11) {
                                when (scanRecord.advertiseFlags and 0b11) {
                                    0b01 -> DiscoverabilityMode.DISCOVERABLE_LIMITED
                                    0b10 -> DiscoverabilityMode.DISCOVERABLE_GENERAL
                                    else -> DiscoverabilityMode.NOT_DISCOVERABLE
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ class Pan(private val context: Context) : PANImplBase(), Closeable {
        }

    init {
        mTetheringManager = context.getSystemService(TetheringManager::class.java)
        mTetheringManager = context.getSystemService(TetheringManager::class.java)!!
    }

    override fun close() {
+2 −0
Original line number Diff line number Diff line
@@ -59,6 +59,8 @@ class Pbap(val context: Context) : PBAPImplBase(), Closeable {
                .getContentResolver()
                .query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null)

        if (cursor == null) return

        if (cursor.getCount() >= CONTACT_LIST_SIZE) return // return if contacts are present

        for (item in cursor.getCount() + 1..CONTACT_LIST_SIZE) {