1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-19 23:12:12 +02:00

If a user mapping already exists, skip the user list and jump directly to selecting the scale user.

This commit is contained in:
oliexdev
2025-08-15 11:10:11 +02:00
parent 3459ac1833
commit 9e4b7f933f

View File

@@ -174,11 +174,21 @@ public abstract class BluetoothStandardWeightProfile extends BluetoothCommunicat
break;
case REQUEST_VENDOR_SPECIFIC_USER_LIST:
scaleUserList.clear();
int uid = (pendingUserId != -1) ? pendingUserId : (this.selectedUser != null ? this.selectedUser.getId() : -1);
int uid = (pendingUserId != -1) ? pendingUserId
: (this.selectedUser != null ? this.selectedUser.getId() : -1);
int idx = getUserScaleIndex(uid);
int cns = getUserScaleConsent(uid);
LogManager.d(TAG, "REQUEST_VENDOR_SPECIFIC_USER_LIST for appUserId=" + uid
+ " -> index=" + idx + ", consent=" + cns);
if (uid != -1 && idx != -1 && cns != -1) {
LogManager.d(TAG, "Mapping present -> skipping user list; jumping to SELECT_SCALE_USER");
jumpNextToStepNr(SM_STEPS.SELECT_SCALE_USER.ordinal());
resumeMachineState();
break;
}
requestVendorSpecificUserList();
stopMachineState();
break;