Skip to content

Commit

Permalink
Incorrect UserAgent (#92)
Browse files Browse the repository at this point in the history
* FullUserAgent Creation

- change string formatting
- generate FullUserAgent when creating telemetry client
  • Loading branch information
electrostat authored Mar 23, 2018
1 parent 71dc5be commit bb3d59e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ private void initializeTelemetryClient() {
}

private TelemetryClient createTelemetryClient(String accessToken, String userAgent) {
TelemetryClientFactory telemetryClientFactory = new TelemetryClientFactory(accessToken, userAgent, new Logger());
String fullUserAgent = TelemetryUtils.createFullUserAgent(userAgent, applicationContext);
TelemetryClientFactory telemetryClientFactory = new TelemetryClientFactory(accessToken, fullUserAgent,
new Logger());
telemetryClient = telemetryClientFactory.obtainTelemetryClient(applicationContext);

return telemetryClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class TelemetryUtils {
static final String MAPBOX_SHARED_PREFERENCE_KEY_VENDOR_ID = "mapboxVendorId";
private static final String DATE_AND_TIME_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
private static final String EMPTY_STRING = "";
private static final String TWO_STRING_FORMAT = "%s%s";
private static final String TWO_STRING_FORMAT = "%s %s";
private static final String THREE_STRING_FORMAT = "%s/%s/%s";
private static final SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_AND_TIME_PATTERN, Locale.US);
private static final Locale DEFAULT_LOCALE = Locale.US;
Expand Down

0 comments on commit bb3d59e

Please sign in to comment.