Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce MapTelemetry.getUserTelemetryRequestState API - MAPSAND-645 #1877

Merged
merged 3 commits into from
Dec 1, 2022

Conversation

pengdev
Copy link
Member

@pengdev pengdev commented Nov 29, 2022

Summary of changes

This PR introduce MapTelemetry.getUserTelemetryRequestState API.

Note that MapTelemetry interface is rewritten in Java: for more context in #1670 (comment), as we want to make the default interface backwards-compatible with Java, writing default method with @JvmDefault in Kotlin will require -Xjvm-default compiler option.

As summarised by @kmadsen

The -Xjvm-default compiler flag may do what we want in the future. But right now, it does not generate default interfaces in an SDK. The app developer has to include the flag in their app to make the app compile when it uses an sdk that is relying on the flag.

User impact (optional)

Pull request checklist:

  • Briefly describe the changes in this PR.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality. If tests were not written, please explain why.
  • Optimize code for java consumption (@JvmOverloads, @file:JvmName, etc).
  • Add example if relevant.
  • Document any changes to public APIs.
  • Run make update-api to update generated api files, if there's public API changes, otherwise the verify-api-* CI steps might fail.
  • Update CHANGELOG.md or use the label 'skip changelog', otherwise check changelog CI step will fail.
  • If this PR is a v10.[version] release branch fix / enhancement, merge it to main firstly and then port to v10.[version] release branch.

Fixes: < Link to related issues that will be fixed by this pull request, if they exist >

PRs must be submitted under the terms of our Contributor License Agreement CLA.

@pengdev pengdev self-assigned this Nov 29, 2022
@pengdev pengdev force-pushed the peng-enable-telemetry-status-getter branch from 7049fce to 97e4367 Compare November 29, 2022 15:35
@@ -540,6 +540,7 @@ public abstract interface class com/mapbox/maps/extension/style/StyleInterface :

public abstract interface class com/mapbox/maps/module/MapTelemetry {
public abstract fun disableTelemetrySession ()V
public fun getTelemetryCollectionState ()Z
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀 this is not abstract 👍


/**
* Definition of map telemetry
*/
interface MapTelemetry {
public interface MapTelemetry {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that MapTelemetry interface is rewritten in Java: for more context in #1670 (comment), as we want to make the default interface backwards-compatible with Java, writing default method with @JvmDefault in Kotlin will require -Xjvm-default compiler option.

As summarised by @kmadsen

The -Xjvm-default compiler flag may do what we want in the future. But right now, it does not generate default interfaces in an SDK. The app developer has to include the flag in their app to make the app compile when it uses an sdk that is relying on the flag.

@pengdev pengdev changed the title Introduce MapTelemetry.getTelemetryCollectionState API. Introduce MapTelemetry.getTelemetryCollectionState API - MAPSAND-645 Nov 30, 2022
@pengdev pengdev marked this pull request as ready for review November 30, 2022 12:25
@pengdev pengdev requested review from a team as code owners November 30, 2022 12:25
@pengdev pengdev force-pushed the peng-enable-telemetry-status-getter branch from 1472861 to 8f93307 Compare November 30, 2022 15:18
@pengdev pengdev changed the title Introduce MapTelemetry.getTelemetryCollectionState API - MAPSAND-645 Introduce MapTelemetry.getUserTelemetryRequestState API - MAPSAND-645 Nov 30, 2022
@pengdev pengdev requested a review from kiryldz November 30, 2022 15:20
@pengdev pengdev merged commit 14b2c80 into main Dec 1, 2022
@pengdev pengdev deleted the peng-enable-telemetry-status-getter branch December 1, 2022 16:48
pengdev added a commit that referenced this pull request Dec 2, 2022
…#1877)

* Introduce MapTelemetry.getTelemetryCollectionState API.

* Add JavaInterfaceChecker for the default function.

* Address review comments.
pengdev added a commit that referenced this pull request Dec 2, 2022
…#1877)

* Introduce MapTelemetry.getTelemetryCollectionState API.

* Add JavaInterfaceChecker for the default function.

* Address review comments.
@kmadsen
Copy link
Contributor

kmadsen commented Dec 7, 2022

Note that there was a response from the kotlin team when I asked about this. https://youtrack.jetbrains.com/issue/KT-54239/-Xjvm-defaultall-for-sdk-development

This problem should have been fixed in 1.6.20. When we update kotlin to version 1.6.20+, the jvm-default=all flag will probably do what we want.

kiryldz added a commit that referenced this pull request Aug 2, 2023
Co-authored-by: Kiryl Dzehtsiarenka <kiryl.dzehtsiarenka@mapbox.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants