fix: Physical Layer (PHY) mask on MIUI for gadgets other than Casio GBX100

This commit is contained in:
Thomas Kuehne
2026-06-05 10:48:25 +00:00
parent 7d9cb26d02
commit 75e25a0e90
2 changed files with 11 additions and 6 deletions
@@ -615,7 +615,11 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
@Override
public int getBlePhyMask() {
return BluetoothDevice.PHY_LE_CODED_MASK;
// this is specified as a recommendation ("prefer to use ...") by Google
// however some roms - e.g. MIUI - treat it as law ("must only use ...") (#6230)
// -> by default prefer more reliable physical layers (PHYs) over high throughput 2M
return BluetoothDevice.PHY_LE_1M_MASK | BluetoothDevice.PHY_LE_CODED_MASK;
}
@Override
@@ -717,7 +717,8 @@ public interface DeviceCoordinator {
/**
* Returns the preferred BLE PHY mask for GATT connections, as passed to
* {@link android.bluetooth.BluetoothDevice#connectGatt}. Defaults to
* {@link android.bluetooth.BluetoothDevice#PHY_LE_CODED_MASK}
* {@link android.bluetooth.BluetoothDevice#PHY_LE_1M_MASK} and
* {@link android.bluetooth.BluetoothDevice#PHY_LE_CODED_MASK}.
*/
int getBlePhyMask();
@@ -733,7 +734,7 @@ public interface DeviceCoordinator {
boolean isExperimental();
/**
* Indicates whether the device has some kind of calender we can sync to.
* Indicates whether the device has some kind of calendar we can sync to.
* Also used for generated sunrise/sunset events
*/
boolean supportsCalendarEvents(@NonNull final GBDevice device);
@@ -834,7 +835,7 @@ public interface DeviceCoordinator {
int getContactsSlotCount(@NonNull final GBDevice device);
/**
* Indicates whether the device has an led which supports custom colors
* Indicates whether the device has an LED which supports custom colors
*/
boolean supportsLedColor(@NonNull final GBDevice device);
@@ -851,7 +852,7 @@ public interface DeviceCoordinator {
int[] getColorPresets();
/**
* Indicates whether the device supports unicode emojis.
* Indicates whether the device supports Unicode emojis.
*/
boolean supportsUnicodeEmojis(@NonNull final GBDevice device);
@@ -1026,4 +1027,4 @@ public interface DeviceCoordinator {
/// @see #supportsMetrics(GBDevice)
@Nullable
GenericMetricSampleProvider getMetricsSampleProvider(@NonNull GBDevice device, @NonNull DaoSession session);
}
}