Skip to content

Commit

Permalink
refactor: spread out
Browse files Browse the repository at this point in the history
  • Loading branch information
arifBurakDemiray committed Mar 22, 2024
1 parent bdc468e commit ab6235e
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,16 @@ private void setIDInternal(String newDeviceID) {
return;
}

// if current type is DEVELOPER_SUPPLIED
// an ID was provided by the host app previously
// we can assume that a device ID change with merge was executed previously
// now we change it without merging
// else
// SDK generated ID
// we change device ID with merge so that data is combined
changeDeviceIdInternal(newDeviceID, DeviceIdType.DEVELOPER_SUPPLIED, !getTypeInternal().equals(DeviceIdType.DEVELOPER_SUPPLIED));
if (getTypeInternal().equals(DeviceIdType.DEVELOPER_SUPPLIED)) {
// an ID was provided by the host app previously
// we can assume that a device ID change with merge was executed previously
// now we change it without merging
changeDeviceIdInternal(newDeviceID, DeviceIdType.DEVELOPER_SUPPLIED, false);
} else {
// SDK generated ID
// we change device ID with merge so that data is combined
changeDeviceIdInternal(newDeviceID, DeviceIdType.DEVELOPER_SUPPLIED, true);
}
}

@Override
Expand Down

0 comments on commit ab6235e

Please sign in to comment.