Глюкометр Satellite: убрать зависимость поля PIN от чекбокса#4
Open
JetFoxy wants to merge 1 commit into
Open
Conversation
The PIN preference was set to depend on bluetooth_meter_enabled, copied from the calibration toggles further down that legitimately depend on an already-working connection. But bluetooth_meter_enabled only gets auto-turned-on by markDeviceAsSuccessful() after a successful first connection - and for Satellite, that first connection can't succeed without the PIN already entered. The dependency made it impossible to ever enter a PIN for a first-time pairing. Removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Проблема
Поле «Satellite meter PIN» в настройках было привязано (
android:dependency="bluetooth_meter_enabled") к чекбоксу «Use Bluetooth Meter» — это поле было недоступно для ввода, пока чекбокс выключен.Чекбокс «Use Bluetooth Meter» включается автоматически только внутри
markDeviceAsSuccessful(), то есть после первого успешного подключения к глюкометру. А для Satellite первое подключение не может завершиться успешно без уже введённого PIN (см.beginSatelliteSession()).Получался замкнутый круг: чтобы ввести PIN — нужно включить чекбокс; чтобы включить чекбокс — нужно успешно подключиться; чтобы подключиться — нужен PIN. Первичная настройка глюкометра Satellite была невозможна.
Исправление
Убрана зависимость
android:dependency="bluetooth_meter_enabled"с поляsatellite_meter_pinвpref_advanced_settings.xml/pref_data_sync.xml. Поле было скопировано по аналогии с чекбоксами калибровки (bluetooth_meter_for_calibrations*), для которых такая зависимость уместна — они управляют поведением уже работающего подключения, а не участвуют в его установлении.Теперь корректный порядок настройки:
Test plan