Merge "Clean up framework classes import" into androidx-main
diff --git a/bluetooth/bluetooth-testing/src/test/kotlin/androidx/bluetooth/testing/RobolectricGattClientTest.kt b/bluetooth/bluetooth-testing/src/test/kotlin/androidx/bluetooth/testing/RobolectricGattClientTest.kt
index 4062e93..1073d7b 100644
--- a/bluetooth/bluetooth-testing/src/test/kotlin/androidx/bluetooth/testing/RobolectricGattClientTest.kt
+++ b/bluetooth/bluetooth-testing/src/test/kotlin/androidx/bluetooth/testing/RobolectricGattClientTest.kt
@@ -25,7 +25,7 @@
import android.bluetooth.BluetoothGattCharacteristic.PROPERTY_READ
import android.bluetooth.BluetoothGattCharacteristic.PROPERTY_WRITE
import android.bluetooth.BluetoothGattDescriptor
-import android.bluetooth.BluetoothGattService
+import android.bluetooth.BluetoothGattService as FwkService
import android.bluetooth.BluetoothManager
import android.content.Context
import androidx.bluetooth.BluetoothDevice
@@ -72,10 +72,10 @@
private val cccdUuid = UUID.fromString("00002902-0000-1000-8000-00805f9b34fb")
- private val service1 = BluetoothGattService(serviceUuid1,
- BluetoothGattService.SERVICE_TYPE_PRIMARY)
- private val service2 = BluetoothGattService(serviceUuid2,
- BluetoothGattService.SERVICE_TYPE_PRIMARY)
+ private val service1 = FwkService(serviceUuid1,
+ FwkService.SERVICE_TYPE_PRIMARY)
+ private val service2 = FwkService(serviceUuid2,
+ FwkService.SERVICE_TYPE_PRIMARY)
private val readCharacteristic = FwkCharacteristic(readCharUuid,
PROPERTY_READ, /*permissions=*/0)
@@ -86,7 +86,7 @@
private val noPropertyCharacteristic = FwkCharacteristic(noPropertyCharUuid,
/*properties=*/0, /*permissions=*/0)
- private val sampleServices: List<BluetoothGattService> = listOf(service1, service2)
+ private val sampleServices: List<FwkService> = listOf(service1, service2)
init {
notifyCharacteristic.addDescriptor(
BluetoothGattDescriptor(cccdUuid, /*permissions=*/0))
@@ -379,7 +379,7 @@
class StubClientFrameworkAdapter(
private val baseAdapter: GattClient.FrameworkAdapter
) : GattClient.FrameworkAdapter {
- var gattServices: List<BluetoothGattService> = listOf()
+ var gattServices: List<FwkService> = listOf()
var callback: BluetoothGattCallback? = null
override var bluetoothGatt: BluetoothGatt?
get() = baseAdapter.bluetoothGatt
@@ -415,11 +415,11 @@
onDiscoverServicesListener?.onDiscoverServices()
}
- override fun getServices(): List<BluetoothGattService> {
+ override fun getServices(): List<FwkService> {
return gattServices
}
- override fun getService(uuid: UUID): BluetoothGattService? {
+ override fun getService(uuid: UUID): FwkService? {
return gattServices.find { it.uuid == uuid }
}
diff --git a/bluetooth/bluetooth-testing/src/test/kotlin/androidx/bluetooth/testing/RobolectricGattServerTest.kt b/bluetooth/bluetooth-testing/src/test/kotlin/androidx/bluetooth/testing/RobolectricGattServerTest.kt
index 740f3ed..5f988ec 100644
--- a/bluetooth/bluetooth-testing/src/test/kotlin/androidx/bluetooth/testing/RobolectricGattServerTest.kt
+++ b/bluetooth/bluetooth-testing/src/test/kotlin/androidx/bluetooth/testing/RobolectricGattServerTest.kt
@@ -18,10 +18,10 @@
import android.bluetooth.BluetoothAdapter
import android.bluetooth.BluetoothDevice as FwkDevice
-import android.bluetooth.BluetoothGattCharacteristic
+import android.bluetooth.BluetoothGattCharacteristic as FwkCharacteristic
import android.bluetooth.BluetoothGattServer
import android.bluetooth.BluetoothGattServerCallback
-import android.bluetooth.BluetoothGattService
+import android.bluetooth.BluetoothGattService as FwkService
import android.bluetooth.BluetoothManager
import android.content.Context
import androidx.bluetooth.BluetoothLe
@@ -429,14 +429,14 @@
baseAdapter.clearServices()
}
- override fun addService(service: BluetoothGattService) {
+ override fun addService(service: FwkService) {
baseAdapter.addService(service)
onAddServiceListener?.onAddService(service)
}
override fun notifyCharacteristicChanged(
device: FwkDevice,
- characteristic: BluetoothGattCharacteristic,
+ characteristic: FwkCharacteristic,
confirm: Boolean,
value: ByteArray
) {
@@ -459,7 +459,7 @@
fun onOpenGattServer()
}
fun interface OnAddServiceListener {
- fun onAddService(service: BluetoothGattService)
+ fun onAddService(service: FwkService)
}
fun interface OnCloseGattServerListener {
fun onCloseGattServer()
@@ -467,7 +467,7 @@
fun interface OnNotifyCharacteristicChangedListener {
fun onNotifyCharacteristicChanged(
device: FwkDevice,
- characteristic: BluetoothGattCharacteristic,
+ characteristic: FwkCharacteristic,
confirm: Boolean,
value: ByteArray
)
diff --git a/bluetooth/bluetooth/src/androidTest/java/androidx/bluetooth/GattCharacteristicTest.kt b/bluetooth/bluetooth/src/androidTest/java/androidx/bluetooth/GattCharacteristicTest.kt
index 5ec0dbd..c5ff1cd 100644
--- a/bluetooth/bluetooth/src/androidTest/java/androidx/bluetooth/GattCharacteristicTest.kt
+++ b/bluetooth/bluetooth/src/androidTest/java/androidx/bluetooth/GattCharacteristicTest.kt
@@ -16,7 +16,7 @@
package androidx.bluetooth
-import android.bluetooth.BluetoothGattCharacteristic as FwkBluetoothGattCharacteristic
+import android.bluetooth.BluetoothGattCharacteristic as FwkCharacteristic
import java.util.UUID
import org.junit.Assert
import org.junit.Test
@@ -28,46 +28,46 @@
@Test
fun constructorWithFwkInstance() {
val propertiesMap = mapOf(
- FwkBluetoothGattCharacteristic.PROPERTY_BROADCAST to
+ FwkCharacteristic.PROPERTY_BROADCAST to
GattCharacteristic.PROPERTY_BROADCAST,
- FwkBluetoothGattCharacteristic.PROPERTY_EXTENDED_PROPS to
+ FwkCharacteristic.PROPERTY_EXTENDED_PROPS to
GattCharacteristic.PROPERTY_EXTENDS_PROP,
- FwkBluetoothGattCharacteristic.PROPERTY_INDICATE to
+ FwkCharacteristic.PROPERTY_INDICATE to
GattCharacteristic.PROPERTY_INDICATE,
- FwkBluetoothGattCharacteristic.PROPERTY_NOTIFY
+ FwkCharacteristic.PROPERTY_NOTIFY
to GattCharacteristic.PROPERTY_NOTIFY,
- FwkBluetoothGattCharacteristic.PROPERTY_READ
+ FwkCharacteristic.PROPERTY_READ
to GattCharacteristic.PROPERTY_READ,
- FwkBluetoothGattCharacteristic.PROPERTY_SIGNED_WRITE
+ FwkCharacteristic.PROPERTY_SIGNED_WRITE
to GattCharacteristic.PROPERTY_SIGNED_WRITE,
- FwkBluetoothGattCharacteristic.PROPERTY_WRITE
+ FwkCharacteristic.PROPERTY_WRITE
to GattCharacteristic.PROPERTY_WRITE,
- FwkBluetoothGattCharacteristic.PROPERTY_WRITE_NO_RESPONSE
+ FwkCharacteristic.PROPERTY_WRITE_NO_RESPONSE
to GattCharacteristic.PROPERTY_WRITE_NO_RESPONSE,
)
val permissionMap = mapOf(
- FwkBluetoothGattCharacteristic.PERMISSION_READ to
+ FwkCharacteristic.PERMISSION_READ to
GattCharacteristic.PERMISSION_READ,
- FwkBluetoothGattCharacteristic.PERMISSION_READ_ENCRYPTED to
+ FwkCharacteristic.PERMISSION_READ_ENCRYPTED to
GattCharacteristic.PERMISSION_READ_ENCRYPTED,
- FwkBluetoothGattCharacteristic.PERMISSION_READ_ENCRYPTED_MITM to
+ FwkCharacteristic.PERMISSION_READ_ENCRYPTED_MITM to
GattCharacteristic.PERMISSION_READ_ENCRYPTED_MITM,
- FwkBluetoothGattCharacteristic.PERMISSION_WRITE to
+ FwkCharacteristic.PERMISSION_WRITE to
GattCharacteristic.PERMISSION_WRITE,
- FwkBluetoothGattCharacteristic.PERMISSION_WRITE_ENCRYPTED to
+ FwkCharacteristic.PERMISSION_WRITE_ENCRYPTED to
GattCharacteristic.PERMISSION_WRITE_ENCRYPTED,
- FwkBluetoothGattCharacteristic.PERMISSION_WRITE_ENCRYPTED_MITM to
+ FwkCharacteristic.PERMISSION_WRITE_ENCRYPTED_MITM to
GattCharacteristic.PERMISSION_WRITE_ENCRYPTED_MITM,
- FwkBluetoothGattCharacteristic.PERMISSION_WRITE_SIGNED to
+ FwkCharacteristic.PERMISSION_WRITE_SIGNED to
GattCharacteristic.PERMISSION_WRITE_SIGNED,
- FwkBluetoothGattCharacteristic.PERMISSION_WRITE_SIGNED_MITM to
+ FwkCharacteristic.PERMISSION_WRITE_SIGNED_MITM to
GattCharacteristic.PERMISSION_WRITE_SIGNED_MITM
)
propertiesMap.forEach {
val charUuid = UUID.randomUUID()
- val fwkGattCharacteristic = FwkBluetoothGattCharacteristic(charUuid, it.key,
+ val fwkGattCharacteristic = FwkCharacteristic(charUuid, it.key,
/*permissions=*/0)
val gattCharacteristic = GattCharacteristic(fwkGattCharacteristic)
@@ -77,7 +77,7 @@
permissionMap.forEach {
val charUuid = UUID.randomUUID()
- val fwkGattCharacteristic = FwkBluetoothGattCharacteristic(charUuid,
+ val fwkGattCharacteristic = FwkCharacteristic(charUuid,
/*properties=*/0, it.key)
val gattCharacteristic = GattCharacteristic(fwkGattCharacteristic)
diff --git a/bluetooth/bluetooth/src/androidTest/java/androidx/bluetooth/GattServiceTest.kt b/bluetooth/bluetooth/src/androidTest/java/androidx/bluetooth/GattServiceTest.kt
index bd40614..18011fd 100644
--- a/bluetooth/bluetooth/src/androidTest/java/androidx/bluetooth/GattServiceTest.kt
+++ b/bluetooth/bluetooth/src/androidTest/java/androidx/bluetooth/GattServiceTest.kt
@@ -16,8 +16,8 @@
package androidx.bluetooth
-import android.bluetooth.BluetoothGattCharacteristic as FwkBluetoothGattCharacteristic
-import android.bluetooth.BluetoothGattService as FwkGattService
+import android.bluetooth.BluetoothGattCharacteristic as FwkCharacteristic
+import android.bluetooth.BluetoothGattService as FwkService
import android.bluetooth.BluetoothGattService.SERVICE_TYPE_PRIMARY
import java.util.UUID
import org.junit.Assert.assertEquals
@@ -32,14 +32,14 @@
@Test
fun constructorWithFwkInstance() {
val serviceUuid = UUID.randomUUID()
- val fwkGattService = FwkGattService(serviceUuid, SERVICE_TYPE_PRIMARY)
+ val fwkGattService = FwkService(serviceUuid, SERVICE_TYPE_PRIMARY)
val charUuid1 = UUID.randomUUID()
- val fwkCharacteristic1 = FwkBluetoothGattCharacteristic(charUuid1, 0, 0)
+ val fwkCharacteristic1 = FwkCharacteristic(charUuid1, 0, 0)
fwkGattService.addCharacteristic(fwkCharacteristic1)
val charUuid2 = UUID.randomUUID()
- val fwkCharacteristic2 = FwkBluetoothGattCharacteristic(charUuid2, 0, 0)
+ val fwkCharacteristic2 = FwkCharacteristic(charUuid2, 0, 0)
fwkGattService.addCharacteristic(fwkCharacteristic2)
val gattService = GattService(fwkGattService)
diff --git a/bluetooth/bluetooth/src/main/java/androidx/bluetooth/BluetoothDevice.kt b/bluetooth/bluetooth/src/main/java/androidx/bluetooth/BluetoothDevice.kt
index 9275145..db9612c 100644
--- a/bluetooth/bluetooth/src/main/java/androidx/bluetooth/BluetoothDevice.kt
+++ b/bluetooth/bluetooth/src/main/java/androidx/bluetooth/BluetoothDevice.kt
@@ -16,7 +16,7 @@
package androidx.bluetooth
-import android.bluetooth.BluetoothDevice as FwkBluetoothDevice
+import android.bluetooth.BluetoothDevice as FwkDevice
import androidx.annotation.RequiresPermission
import androidx.annotation.RestrictTo
import java.util.UUID
@@ -31,7 +31,7 @@
*
*/
class BluetoothDevice @RestrictTo(RestrictTo.Scope.LIBRARY) constructor(
- internal val fwkDevice: FwkBluetoothDevice
+ internal val fwkDevice: FwkDevice
) {
val id: UUID = UUID.randomUUID()
diff --git a/bluetooth/bluetooth/src/main/java/androidx/bluetooth/GattCharacteristic.kt b/bluetooth/bluetooth/src/main/java/androidx/bluetooth/GattCharacteristic.kt
index 577d196..09aa60f 100644
--- a/bluetooth/bluetooth/src/main/java/androidx/bluetooth/GattCharacteristic.kt
+++ b/bluetooth/bluetooth/src/main/java/androidx/bluetooth/GattCharacteristic.kt
@@ -16,7 +16,7 @@
package androidx.bluetooth
-import android.bluetooth.BluetoothGattCharacteristic
+import android.bluetooth.BluetoothGattCharacteristic as FwkCharacteristic
import androidx.annotation.RestrictTo
import java.util.UUID
@@ -26,66 +26,66 @@
@RestrictTo(RestrictTo.Scope.LIBRARY)
class GattCharacteristic internal constructor(
@get:RestrictTo(RestrictTo.Scope.LIBRARY)
- var fwkCharacteristic: BluetoothGattCharacteristic
+ var fwkCharacteristic: FwkCharacteristic
) {
companion object {
/**
* It permits broadcasts of the characteristic.
*/
- const val PROPERTY_BROADCAST = BluetoothGattCharacteristic.PROPERTY_BROADCAST
+ const val PROPERTY_BROADCAST = FwkCharacteristic.PROPERTY_BROADCAST
/**
* It permits reads of the characteristic.
*/
- const val PROPERTY_READ = BluetoothGattCharacteristic.PROPERTY_READ
+ const val PROPERTY_READ = FwkCharacteristic.PROPERTY_READ
/**
* It permits writes of the characteristic without response.
*/
const val PROPERTY_WRITE_NO_RESPONSE =
- BluetoothGattCharacteristic.PROPERTY_WRITE_NO_RESPONSE
+ FwkCharacteristic.PROPERTY_WRITE_NO_RESPONSE
/**
* It permits writes of the characteristic with response.
*/
- const val PROPERTY_WRITE = BluetoothGattCharacteristic.PROPERTY_WRITE
+ const val PROPERTY_WRITE = FwkCharacteristic.PROPERTY_WRITE
/**
* It permits notifications of a characteristic value without acknowledgment.
*/
- const val PROPERTY_NOTIFY = BluetoothGattCharacteristic.PROPERTY_NOTIFY
+ const val PROPERTY_NOTIFY = FwkCharacteristic.PROPERTY_NOTIFY
/**
* It permits indications of a characteristic value with acknowledgment.
*/
- const val PROPERTY_INDICATE = BluetoothGattCharacteristic.PROPERTY_INDICATE
+ const val PROPERTY_INDICATE = FwkCharacteristic.PROPERTY_INDICATE
/**
* It permits signed writes to the characteristic value.
*/
- const val PROPERTY_SIGNED_WRITE = BluetoothGattCharacteristic.PROPERTY_SIGNED_WRITE
+ const val PROPERTY_SIGNED_WRITE = FwkCharacteristic.PROPERTY_SIGNED_WRITE
/**
* Additional characteristic properties are defined.
*/
- const val PROPERTY_EXTENDS_PROP = BluetoothGattCharacteristic.PROPERTY_EXTENDED_PROPS
+ const val PROPERTY_EXTENDS_PROP = FwkCharacteristic.PROPERTY_EXTENDED_PROPS
- const val PERMISSION_READ: Int = BluetoothGattCharacteristic.PERMISSION_READ
+ const val PERMISSION_READ: Int = FwkCharacteristic.PERMISSION_READ
const val PERMISSION_READ_ENCRYPTED: Int =
- BluetoothGattCharacteristic.PERMISSION_READ_ENCRYPTED
+ FwkCharacteristic.PERMISSION_READ_ENCRYPTED
const val PERMISSION_READ_ENCRYPTED_MITM: Int =
- BluetoothGattCharacteristic.PERMISSION_READ_ENCRYPTED_MITM
- const val PERMISSION_WRITE: Int = BluetoothGattCharacteristic.PERMISSION_WRITE
+ FwkCharacteristic.PERMISSION_READ_ENCRYPTED_MITM
+ const val PERMISSION_WRITE: Int = FwkCharacteristic.PERMISSION_WRITE
const val PERMISSION_WRITE_ENCRYPTED: Int =
- BluetoothGattCharacteristic.PERMISSION_WRITE_ENCRYPTED
+ FwkCharacteristic.PERMISSION_WRITE_ENCRYPTED
const val PERMISSION_WRITE_ENCRYPTED_MITM: Int =
- BluetoothGattCharacteristic.PERMISSION_WRITE_ENCRYPTED_MITM
- const val PERMISSION_WRITE_SIGNED: Int = BluetoothGattCharacteristic.PERMISSION_WRITE_SIGNED
+ FwkCharacteristic.PERMISSION_WRITE_ENCRYPTED_MITM
+ const val PERMISSION_WRITE_SIGNED: Int = FwkCharacteristic.PERMISSION_WRITE_SIGNED
const val PERMISSION_WRITE_SIGNED_MITM: Int =
- BluetoothGattCharacteristic.PERMISSION_WRITE_SIGNED_MITM
+ FwkCharacteristic.PERMISSION_WRITE_SIGNED_MITM
- const val WRITE_TYPE_DEFAULT: Int = BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT
- const val WRITE_TYPE_SIGNED: Int = BluetoothGattCharacteristic.WRITE_TYPE_SIGNED
- const val WRITE_TYPE_NO_RESPONSE: Int = BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE
+ const val WRITE_TYPE_DEFAULT: Int = FwkCharacteristic.WRITE_TYPE_DEFAULT
+ const val WRITE_TYPE_SIGNED: Int = FwkCharacteristic.WRITE_TYPE_SIGNED
+ const val WRITE_TYPE_NO_RESPONSE: Int = FwkCharacteristic.WRITE_TYPE_NO_RESPONSE
}
/**
@@ -114,6 +114,6 @@
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
fun GattCharacteristic(uuid: UUID, properties: Int, permissions: Int): GattCharacteristic {
- val fwkCharacteristic = BluetoothGattCharacteristic(uuid, properties, permissions)
+ val fwkCharacteristic = FwkCharacteristic(uuid, properties, permissions)
return GattCharacteristic(fwkCharacteristic)
}
diff --git a/bluetooth/bluetooth/src/main/java/androidx/bluetooth/GattServer.kt b/bluetooth/bluetooth/src/main/java/androidx/bluetooth/GattServer.kt
index 293c76b..61186f0 100644
--- a/bluetooth/bluetooth/src/main/java/androidx/bluetooth/GattServer.kt
+++ b/bluetooth/bluetooth/src/main/java/androidx/bluetooth/GattServer.kt
@@ -18,12 +18,12 @@
import android.Manifest.permission.BLUETOOTH_CONNECT
import android.annotation.SuppressLint
-import android.bluetooth.BluetoothDevice as FwkBluetoothDevice
+import android.bluetooth.BluetoothDevice as FwkDevice
import android.bluetooth.BluetoothGatt
import android.bluetooth.BluetoothGattCharacteristic as FwkCharacteristic
import android.bluetooth.BluetoothGattServer
import android.bluetooth.BluetoothGattServerCallback
-import android.bluetooth.BluetoothGattService
+import android.bluetooth.BluetoothGattService as FwkService
import android.bluetooth.BluetoothManager
import android.bluetooth.BluetoothProfile
import android.content.Context
@@ -50,15 +50,15 @@
fun openGattServer(context: Context, callback: BluetoothGattServerCallback)
fun closeGattServer()
fun clearServices()
- fun addService(service: BluetoothGattService)
+ fun addService(service: FwkService)
fun notifyCharacteristicChanged(
- device: FwkBluetoothDevice,
+ device: FwkDevice,
characteristic: FwkCharacteristic,
confirm: Boolean,
value: ByteArray
)
fun sendResponse(
- device: FwkBluetoothDevice,
+ device: FwkDevice,
requestId: Int,
status: Int,
offset: Int,
@@ -82,7 +82,7 @@
}
// Should be accessed only from the callback thread
- private val sessions: MutableMap<FwkBluetoothDevice, Session> = mutableMapOf()
+ private val sessions: MutableMap<FwkDevice, Session> = mutableMapOf()
private val attributeMap = AttributeMap()
@SuppressLint("ObsoleteSdkInt")
@@ -97,7 +97,7 @@
attributeMap.updateWithServices(services)
val callback = object : BluetoothGattServerCallback() {
override fun onConnectionStateChange(
- device: FwkBluetoothDevice,
+ device: FwkDevice,
status: Int,
newState: Int
) {
@@ -116,7 +116,7 @@
}
override fun onCharacteristicReadRequest(
- device: FwkBluetoothDevice,
+ device: FwkDevice,
requestId: Int,
offset: Int,
characteristic: FwkCharacteristic
@@ -134,7 +134,7 @@
}
override fun onCharacteristicWriteRequest(
- device: FwkBluetoothDevice,
+ device: FwkDevice,
requestId: Int,
characteristic: FwkCharacteristic,
preparedWrite: Boolean,
@@ -206,24 +206,24 @@
}
}
- internal fun findActiveSessionWithDevice(device: FwkBluetoothDevice): Session? {
+ internal fun findActiveSessionWithDevice(device: FwkDevice): Session? {
return sessions[device]?.takeIf {
it.state.get() != Session.State.DISCONNECTED
}
}
- internal fun addSession(device: FwkBluetoothDevice): Session {
+ internal fun addSession(device: FwkDevice): Session {
return Session().apply {
sessions[device] = this
}
}
- internal fun removeSession(device: FwkBluetoothDevice) {
+ internal fun removeSession(device: FwkDevice) {
sessions.remove(device)
}
internal fun sendResponse(
- device: FwkBluetoothDevice,
+ device: FwkDevice,
requestId: Int,
status: Int,
offset: Int,
@@ -256,14 +256,14 @@
}
@RequiresPermission(BLUETOOTH_CONNECT)
- override fun addService(service: BluetoothGattService) {
+ override fun addService(service: FwkService) {
gattServer?.addService(service)
}
@Suppress("DEPRECATION")
@RequiresPermission(BLUETOOTH_CONNECT)
override fun notifyCharacteristicChanged(
- device: FwkBluetoothDevice,
+ device: FwkDevice,
characteristic: FwkCharacteristic,
confirm: Boolean,
value: ByteArray
@@ -274,7 +274,7 @@
@RequiresPermission(BLUETOOTH_CONNECT)
override fun sendResponse(
- device: android.bluetooth.BluetoothDevice,
+ device: FwkDevice,
requestId: Int,
status: Int,
offset: Int,
@@ -287,7 +287,7 @@
private open class FrameworkAdapterApi33 : FrameworkAdapterBase() {
@RequiresPermission(BLUETOOTH_CONNECT)
override fun notifyCharacteristicChanged(
- device: FwkBluetoothDevice,
+ device: FwkDevice,
characteristic: FwkCharacteristic,
confirm: Boolean,
value: ByteArray
diff --git a/bluetooth/bluetooth/src/main/java/androidx/bluetooth/GattServerRequest.kt b/bluetooth/bluetooth/src/main/java/androidx/bluetooth/GattServerRequest.kt
index cd9e4581..a386bc8 100644
--- a/bluetooth/bluetooth/src/main/java/androidx/bluetooth/GattServerRequest.kt
+++ b/bluetooth/bluetooth/src/main/java/androidx/bluetooth/GattServerRequest.kt
@@ -16,7 +16,7 @@
package androidx.bluetooth
-import android.bluetooth.BluetoothDevice
+import android.bluetooth.BluetoothDevice as FwkDevice
import android.bluetooth.BluetoothGatt.GATT_READ_NOT_PERMITTED
import android.bluetooth.BluetoothGatt.GATT_SUCCESS
import android.bluetooth.BluetoothGatt.GATT_WRITE_NOT_PERMITTED
@@ -26,7 +26,7 @@
interface GattServerRequest {
class ReadCharacteristicRequest internal constructor(
private val server: GattServer,
- internal val device: BluetoothDevice,
+ internal val device: FwkDevice,
private val requestId: Int,
val offset: Int,
val characteristic: GattCharacteristic
@@ -44,7 +44,7 @@
class WriteCharacteristicRequest internal constructor(
private val server: GattServer,
- internal val device: BluetoothDevice,
+ internal val device: FwkDevice,
private val requestId: Int,
val characteristic: GattCharacteristic,
val isPreparedWrite: Boolean,
diff --git a/bluetooth/bluetooth/src/main/java/androidx/bluetooth/GattService.kt b/bluetooth/bluetooth/src/main/java/androidx/bluetooth/GattService.kt
index 15f71c5..68d6acd 100644
--- a/bluetooth/bluetooth/src/main/java/androidx/bluetooth/GattService.kt
+++ b/bluetooth/bluetooth/src/main/java/androidx/bluetooth/GattService.kt
@@ -16,7 +16,7 @@
package androidx.bluetooth
-import android.bluetooth.BluetoothGattService
+import android.bluetooth.BluetoothGattService as FwkService
import androidx.annotation.RestrictTo
import java.util.UUID
@@ -25,7 +25,7 @@
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
class GattService internal constructor(
- internal val fwkService: BluetoothGattService,
+ internal val fwkService: FwkService,
characteristics: List<GattCharacteristic>? = null
) {
val uuid: UUID
@@ -44,7 +44,7 @@
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
fun GattService(uuid: UUID, characteristics: List<GattCharacteristic>): GattService {
- val fwkService = BluetoothGattService(uuid, BluetoothGattService.SERVICE_TYPE_PRIMARY)
+ val fwkService = FwkService(uuid, FwkService.SERVICE_TYPE_PRIMARY)
characteristics.forEach { fwkService.addCharacteristic(it.fwkCharacteristic) }
return GattService(fwkService, characteristics)
}