Infeasible
Status Update
Comments
gg...@google.com <gg...@google.com> #2
These changes would be really nice! Being able to change the text colour is really important as it now doesn't match the rest of our app either.
Stack overflow posting -http://stackoverflow.com/questions/32533069/how-to-change-a-title-color-in-chrome-custom-tabs
Stack overflow posting -
lk...@gmail.com <lk...@gmail.com> #3
Changing text color and the overflow icon color is important to us too! Awesome work on the feature though.
vi...@google.com <vi...@google.com> #4
The ability of customize the status bar color is very important!
j....@engisoft.com <j....@engisoft.com> #5
It is in the essence of a "custom" UI component to have a custom color. Please add this feature!
vi...@google.com <vi...@google.com> #6
I have noted that the status bar automatically generated from the toolbar color is a bit darker than needed. The status bar color of the chrome activity is different to the one of the rest of my app. It doesn't strictly follow Material guidelines.
vi...@google.com <vi...@google.com> #7
The same issue I met. And is there a way to customize the title? using my own title rather than the url's. Thanks
Description
I am experiencing an issue with BLE notifications on certain devices, specifically Google Pixel and Samsung Galaxy models. The problem occurs when receiving a response that is longer than the MTU size, causing it to be split into two parts. On these devices, I only receive the second part of the message.
When initiating communication with the BLE device, we first do the discoverServices() and set the MTU to 512.
After that, we send an initial message through a specific BluetoothGattCharacteristic.
Then, we expect to receive a JSON response from the device split into two parts due to its length. However, on Google Pixel and Samsung Galaxy devices, only the second part of the message is received (the method onCharacteristicChanged is invoked only once on the devices mentioned, meanwhile that is invoked twice on the rest of the devices we have tested).
The issue was detected with Android 14 and tested with the brand-new Android 15, but it has not been solved with the new OS update.
Any clue about what can be causing this behaviour? I have attached a code snippet below:
**Code:**
```
// STEP 1 - Connect to the BluetoothDevice
fun connect(device: BluetoothDevice, context: Context) {
try {
device.connectGatt(context, false, callback)
} catch (e: SecurityException) {
Log.d("Error connecting to ${device.address}")
}
}
private val callback = object : BluetoothGattCallback() {
// STEP 2 - Request the services after a successful connection
override fun onConnectionStateChange(gatt: BluetoothGatt, status: Int, newState: Int) {
try {
val deviceAddress = gatt.device.address
if (status == BluetoothGatt.GATT_SUCCESS) {
if (newState == BluetoothProfile.STATE_CONNECTED) {
Handler(Looper.getMainLooper()).post {
gatt.discoverServices()
}
} else if (newState == BluetoothProfile.STATE_DISCONNECTED) {
disconnect()
}
} else {
disconnect(status)
}
} catch (e: SecurityException) {
Log.d("onConnectionStateChange: Error occurred $e")
}
}
// STEP 3 - MTU request after a successful discoverServices()
override fun onServicesDiscovered(gatt: BluetoothGatt, status: Int) {
try {
with(gatt) {
if (status == BluetoothGatt.GATT_SUCCESS) {
requestMtu(512)
} else {
disconnect()
}
}
} catch (e: SecurityException) {
Log.d("onServicesDiscovered: Error occurred $e")
}
}
// STEP 4 - Send message after setting the MTU properly
override fun onMtuChanged(gatt: BluetoothGatt, mtu: Int, status: Int) {
if (status == BluetoothGatt.GATT_SUCCESS) {
deviceBluetoothGatt!!.services?.firstOrNull { it.uuid == serviceUUID.uuid }?.let { service ->
val characteristic = service.characteristics.first { it.uuid == readCharacteristicUUID }
try {
deviceBluetoothGatt!!.findCharacteristic(characteristic.uuid)?.let { _ ->
val payload = when {
characteristic.isIndicatable() -> BluetoothGattDescriptor.ENABLE_INDICATION_VALUE
characteristic.isNotifiable() -> BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE
else -> error("${characteristic.uuid} doesn't support notifications/indications")
}
characteristic.getDescriptor(configurationCharacteristicUUID)?.let { cccDescriptor ->
if (!deviceBluetoothGatt!!.setCharacteristicNotification(characteristic, true)) {
return
}
cccDescriptor.value = payload
deviceBluetoothGatt!!.writeDescriptor(cccDescriptor)
} ?: this@BLEManager.run {
Log.e("${characteristic.uuid} doesn't contain the CCC descriptor!")
}
} ?: this@BLEManager.run {
Log.e("Cannot find $characteristic.uuid! Failed to enable notifications.")
}
} catch (e: SecurityException) {
Log.d("onMtuChanged: Error occurred: $e")
}
}
} else {
Log.d("onMtuChanged: Error occurred $e")
disconnect()
}
}
// STEP 5 - Receive the message on this callback in blocks
override fun onCharacteristicChanged(gatt: BluetoothGatt, characteristic: BluetoothGattCharacteristic) {
with(characteristic) {
decodeResponse(characteristic.value)
}
}
override fun onDescriptorWrite(gatt: BluetoothGatt, descriptor: BluetoothGattDescriptor, status: Int) {
with(descriptor) {
when (status) {
BluetoothGatt.GATT_SUCCESS -> {
writeCharacteristic(GetinfoRequest().encode())
}
BluetoothGatt.GATT_WRITE_NOT_PERMITTED -> {
Log.d("Write not permitted for $uuid!")
}
else -> {
Log.d("Descriptor write failed for $uuid, error: $status")
}
}
}
}
}
```
**Additional Information:**
- Android versions tested: Android 14, Android 15
- Devices affected: Google Pixel 6A, Galaxy Tab S8