-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce MapTelemetry.getUserTelemetryRequestState API - MAPSAND-645 (…
…#1877) * Introduce MapTelemetry.getTelemetryCollectionState API. * Add JavaInterfaceChecker for the default function. * Address review comments.
- Loading branch information
Showing
5 changed files
with
71 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
37 changes: 26 additions & 11 deletions
37
...va/com/mapbox/maps/module/MapTelemetry.kt → .../com/mapbox/maps/module/MapTelemetry.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,67 @@ | ||
package com.mapbox.maps.module | ||
package com.mapbox.maps.module; | ||
|
||
import android.os.Bundle | ||
import android.os.Bundle; | ||
|
||
import androidx.annotation.Nullable; | ||
|
||
import com.mapbox.common.TelemetryUtils; | ||
|
||
/** | ||
* Definition of map telemetry | ||
*/ | ||
interface MapTelemetry { | ||
public interface MapTelemetry { | ||
|
||
/** | ||
* Register the app user turnstile event | ||
*/ | ||
fun onAppUserTurnstileEvent() | ||
void onAppUserTurnstileEvent(); | ||
|
||
/** | ||
* Set the end-user selected state to participate or opt-out in telemetry collection. | ||
*/ | ||
fun setUserTelemetryRequestState(enabled: Boolean) | ||
void setUserTelemetryRequestState(boolean enabled); | ||
|
||
/** | ||
* Disables a started telemetry service for this session only. | ||
*/ | ||
fun disableTelemetrySession() | ||
void disableTelemetrySession(); | ||
|
||
/** | ||
* Set the debug logging enabled states. | ||
* | ||
* @deprecated | ||
* Note this method is deprecated, there will be no operations when it is called. | ||
* | ||
* @param debugLoggingEnabled whether to enable the debug logging for telemetry. | ||
*/ | ||
@Deprecated("setDebugLoggingEnabled has been deprecated and will do no operations") | ||
fun setDebugLoggingEnabled(debugLoggingEnabled: Boolean) | ||
@Deprecated | ||
void setDebugLoggingEnabled(boolean debugLoggingEnabled); | ||
|
||
/** | ||
* Set the telemetry rotation session id interval. | ||
* | ||
* @deprecated | ||
* Note this method is deprecated, there will be no operations when it is called. | ||
* | ||
* @param interval the selected session interval | ||
* @return true if rotation session id was updated | ||
*/ | ||
@Deprecated("setSessionIdRotationInterval has been deprecated and will do no operations") | ||
fun setSessionIdRotationInterval(interval: Int): Boolean | ||
@Deprecated | ||
boolean setSessionIdRotationInterval(int interval); | ||
|
||
/** | ||
* Register a performance event. | ||
* | ||
* @param data performance event data | ||
*/ | ||
fun onPerformanceEvent(data: Bundle?) | ||
void onPerformanceEvent(@Nullable Bundle data); | ||
|
||
/** | ||
* Get the end-user selected state to participate or opt-out in telemetry collection. | ||
* | ||
* @return true if end-user opted-in in telemetry collection, false otherwise. | ||
*/ | ||
default boolean getUserTelemetryRequestState() { | ||
return TelemetryUtils.getEventsCollectionState(); | ||
} | ||
} |