Bluetooth-assisted Push to Talk (PTT) via Element Call#6464
Bluetooth-assisted Push to Talk (PTT) via Element Call#6464
Conversation
Ktlint Results👎 |
|
SonarCloud Quality Gate failed. |
| } | ||
| } | ||
|
|
||
| override fun onPause() { |
There was a problem hiding this comment.
Do we possibly want to keep this for non-Element-Call widgets?
There was a problem hiding this comment.
Exactly, it is in my to-do list. Nice catch though, thanks.
|
|
||
| override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { | ||
| val notification = notificationUtils.buildBluetoothLowEnergyNotification() | ||
| startForeground(Random.nextInt(), notification) |
There was a problem hiding this comment.
We need to kill the service when the WidgetFragment is destroyed.
There was a problem hiding this comment.
We should also disconnect from the bluetooth device which it looks like we might not be doing currently
by setting the appropriate descriptor, which apparently is not a thing that setCharacteristicNotification does
Enable notifications for characteristic changes
|
|
||
| override fun onScanResult(device: BluetoothDevice) { | ||
| Timber.d("### WidgetFragment. New BLE device found: " + device.name + " - " + device.address) | ||
| if (device.name == null || bluetoothDevices.map { it.address }.contains(device.address)) { |
There was a problem hiding this comment.
This kind of logic and even this method should not be in the fragment if we want to merge this into the develop at one point.
| bluetoothManager | ||
| ?.adapter | ||
| ?.bondedDevices | ||
| ?.firstOrNull { it.name == "PTT-Z" } |
There was a problem hiding this comment.
We should improve the UX with extra screens to get rid of the hardcoded device name.
| override fun onServicesDiscovered(gatt: BluetoothGatt, status: Int) { | ||
| gatt.services.forEach { service -> | ||
| service.characteristics.forEach { characteristic -> | ||
| if (characteristic.uuid.equals(UUID.fromString("0000ffe1-0000-1000-8000-00805f9b34fb"))) { |
There was a problem hiding this comment.
We should improve the UX with extra screens to get rid of the hardcoded uuid.
| service.characteristics.forEach { characteristic -> | ||
| if (characteristic.uuid.equals(UUID.fromString("0000ffe1-0000-1000-8000-00805f9b34fb"))) { | ||
| gatt.setCharacteristicNotification(characteristic, true) | ||
| val descriptor = characteristic.getDescriptor(UUID.fromString("00002902-0000-1000-8000-00805f9b34fb")) |
There was a problem hiding this comment.
We should improve the UX with extra screens to get rid of the hardcoded uuid.
Signed-off-by: Johannes Marbach <johannesm@element.io>
Suppress webview / checkbox permission dialog
|
SonarCloud Quality Gate failed. |
|
@onurays what is the status of the PR? |
The old one has disappeared from Netlify. This replaces it with a ROSA deployment like our live EC which shouldn't randomly go away.
Update to new Element Call URL
…feature/ons/ptt_bluetooth
…eature/ons/ptt_bluetooth
Allow events to be collected in the background
Start Element Call widget in its own task So that closing the app does not end a PTT call
| package im.vector.app.features.widgets | ||
|
|
||
| import android.app.Activity | ||
| import android.bluetooth.BluetoothDevice |
| import im.vector.app.features.settings.VectorPreferences | ||
| import im.vector.app.features.webview.WebEventListener | ||
| import im.vector.app.features.widgets.ptt.BluetoothLowEnergyDevice | ||
| import im.vector.app.features.widgets.ptt.BluetoothLowEnergyDeviceScanner |
| import org.matrix.android.sdk.flow.mapOptional | ||
| import org.matrix.android.sdk.flow.unwrap | ||
| import timber.log.Timber | ||
| import javax.inject.Inject |
|
SonarCloud Quality Gate failed. |
|
Onuray Sahin seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |








This is a proof-of-concept implementation of hardware-supported Push-to-Talk (PTT) using Element Call in a widget.
ptt_bottomsheet.mp4