Migrate to 3.1.10
This guide outlines the breaking changes introduced in SDK version 3.1.10. Required updates may vary depending on your use case.
Additionally, new features and bugfixes have been introduced and are not documented here. For a comprehensive list of changes, please refer to the changelog.
This release changes the return type of a TrafficService method so it can report several active restrictions at once, and updates how the Android plugin is built. Most projects only need updates if they call getOnlineServiceRestrictions or build on an older Android Gradle Plugin version.
The getOnlineServiceRestrictions method of the TrafficService class now returns a Set
The getOnlineServiceRestrictions method now returns a Set<TrafficOnlineRestrictions> with all active restrictions instead of a single TrafficOnlineRestrictions value. This allows the method to report multiple restrictions that apply at the same time, which a single value could not express.
Update any variables or method signatures that expect a single TrafficOnlineRestrictions value to use Set<TrafficOnlineRestrictions> instead.
Before:
TrafficOnlineRestrictions restriction = TrafficService.getOnlineServiceRestrictions(coords);
After:
Set<TrafficOnlineRestrictions> restrictions = TrafficService.getOnlineServiceRestrictions(coords);
The Android plugin now builds using AGP's built-in Kotlin support
The SDK's Android plugin is now compiled using the Android Gradle Plugin's built-in Kotlin support instead of applying the standalone Kotlin Gradle plugin.
For the full set of steps to adapt your project, see Android's official Migrate to built-in Kotlin guide.