Skip to content

Commit

Permalink
Revert "Apply commits in #443 #444 #445 #457 as a patch"
Browse files Browse the repository at this point in the history
This reverts commit 34bba45.
  • Loading branch information
Harsha Sura committed Mar 17, 2020
1 parent 34bba45 commit ff91d41
Show file tree
Hide file tree
Showing 20 changed files with 16 additions and 149 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
- deploy:
name: Publish to Maven Central
command: |
if [[ $CIRCLE_BRANCH == long-term-support ]]; then
if [[ $CIRCLE_BRANCH == master ]]; then
make publish-core ;
make publish-telem ;
elif [[ $CIRCLE_TAG == telem-* ]]; then
Expand All @@ -145,7 +145,7 @@ jobs:
name: Check & Publish Binary Size
command: |
binary_path="libtelemetry/build/outputs/aar/libtelemetry-full-release.aar"
if [[ $CIRCLE_BRANCH == long-term-support ]] || [[ $CIRCLE_BRANCH == release-* ]]; then
if [[ $CIRCLE_BRANCH == master ]] || [[ $CIRCLE_BRANCH == release-* ]]; then
./scripts/capture_binary_size_for_aws.sh $binary_path "mapbox-events-android"
else
./scripts/check_binary_size.sh $binary_path "Telemetry-AAR"
Expand Down
3 changes: 0 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ android {
release {
minifyEnabled true
}
debug {
minifyEnabled true
}
}

flavorDimensions "version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,6 @@ public void onClick(View v) {
}
}
});

Button sendTurnstile = findViewById(R.id.turnstile);

sendTurnstile.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mapboxTelemetry.push(new AppUserTurnstile("fooSdk", "1.0.0"));
}
});
}

@SuppressLint("MissingPermission")
Expand Down Expand Up @@ -184,9 +175,6 @@ public void run() {
});
}
Log.i(LOG_TAG, message);
if (!successful) {
throw new AssertionError("Failed to POST Event: " + code);
}
}

@Override
Expand All @@ -201,7 +189,6 @@ public void run() {
});
}
Log.e(LOG_TAG, "Failure: " + message);
throw new AssertionError("Failed to POST Event");
}
}
}
Expand Down
11 changes: 0 additions & 11 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,4 @@
app:layout_constraintTop_toTopOf="parent" android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintVertical_bias="0.076"/>

<Button
android:text="Send Turnstile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/turnstile"
android:layout_marginTop="20dp"
android:padding="10dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/fill_queue"/>

</android.support.constraint.ConstraintLayout>
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ext {

pluginVersion = [
checkstyle : '8.4',
gradle : '3.5.3',
gradle : '3.4.1',
dependencyGraph : '0.5.0',
mapboxSdkVersions: '1.0.1'
]
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Dec 06 11:54:00 PST 2019
#Thu Jun 06 12:04:38 PDT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
2 changes: 1 addition & 1 deletion libcore/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=1.4.2-SNAPSHOT
VERSION_NAME=1.4.0-SNAPSHOT
POM_ARTIFACT_ID=mapbox-android-core
POM_NAME=Mapbox Android Core Library
POM_DESCRIPTION=Mapbox Android Core Library
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
libcore/1.4.2-SNAPSHOT
libcore/1.4.0-SNAPSHOT
v1
2 changes: 1 addition & 1 deletion libtelemetry/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=4.7.4-SNAPSHOT
VERSION_NAME=4.7.0-SNAPSHOT
POM_ARTIFACT_ID=mapbox-android-telemetry
POM_NAME=Mapbox Android Telemetry Library
POM_DESCRIPTION=Mapbox Android Telemetry Library
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@

import android.annotation.SuppressLint;
import android.os.Parcel;
import android.support.annotation.Keep;
import android.text.TextUtils;


import com.google.gson.annotations.SerializedName;

/**
* This class is temporary and exists only
* to comply with legacy telemetry interface,
Expand All @@ -16,34 +12,20 @@
* back and forth json serialization overhead.
*/
@SuppressLint("ParcelCreator")
@Keep
public class CrashEvent extends Event {
@SerializedName("event")
private final String event;
@SerializedName("created")
private final String created;

@SerializedName("sdkIdentifier")
private String sdkIdentifier;
@SerializedName("sdkVersion")
private String sdkVersion;
@SerializedName("osVersion")
private String osVersion;
@SerializedName("model")
private String model;
@SerializedName("device")
private String device;
@SerializedName("isSilent")
private String isSilent;
@SerializedName("stackTraceHash")
private String stackTraceHash;
@SerializedName("stackTrace")
private String stackTrace;
@SerializedName("threadDetails")
private String threadDetails;
@SerializedName("appId")
private String appId;
@SerializedName("appVersion")
private String appVersion;

public CrashEvent(String event, String created) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import android.support.v4.content.LocalBroadcastManager;

import android.util.Log;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
Expand Down Expand Up @@ -226,16 +225,8 @@ private boolean isUserAgentValid(String userAgent) {

private void initializeTelemetryClient() {
if (configurationClient == null) {
if (BuildConfig.DEBUG) {
// Strict mode work around : https://github.com/square/okhttp/issues/3537
this.configurationClient = new ConfigurationClient(applicationContext,
TelemetryUtils.createFullUserAgent(userAgent, applicationContext), sAccessToken.get(),
TelemetryUtils.createOkHttpClientWithStrictModeWorkAround());
} else {
this.configurationClient = new ConfigurationClient(applicationContext,
TelemetryUtils.createFullUserAgent(userAgent, applicationContext), sAccessToken.get(),
new OkHttpClient());
}
this.configurationClient = new ConfigurationClient(applicationContext,
TelemetryUtils.createFullUserAgent(userAgent, applicationContext), sAccessToken.get(), new OkHttpClient());
}

if (certificateBlacklist == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
libtelemetry/4.7.4-SNAPSHOT
libtelemetry/4.7.0-SNAPSHOT
v1
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,28 @@
import android.os.Parcel;
import android.os.Parcelable;

import android.support.annotation.Keep;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import com.google.gson.annotations.SerializedName;

import static com.mapbox.android.telemetry.TelemetryEnabler.TELEMETRY_STATES;

@Keep
public class AppUserTurnstile extends Event implements Parcelable {
private static final String APP_USER_TURNSTILE = "appUserTurnstile";
private static final String OPERATING_SYSTEM = "Android - " + Build.VERSION.RELEASE;
private static final String APPLICATION_CONTEXT_CANT_BE_NULL = "Create a MapboxTelemetry instance before calling "
+ "this method.";

@SerializedName("event")
private final String event;
@SerializedName("created")
private final String created;
@SerializedName("userId")
private final String userId;
@SerializedName("enabled.telemetry")
private final boolean enabledTelemetry;
@SerializedName("device")
private final String device;
@SerializedName("sdkIdentifier")
private final String sdkIdentifier;
@SerializedName("sdkVersion")
private final String sdkVersion;
@SerializedName("model")
private final String model;
@SerializedName("operatingSystem")
private final String operatingSystem;
@SerializedName("skuId")
private String skuId;

public AppUserTurnstile(String sdkIdentifier, String sdkVersion) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@

import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.Keep;


import com.google.gson.annotations.SerializedName;

import java.util.ArrayList;
import java.util.List;

@Keep
public class Attachment extends Event implements Parcelable {
private static final String VIS_ATTACHMENT = "vis.attachment";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.Keep;

import com.google.gson.annotations.SerializedName;

@Keep
public class LocationEvent extends Event implements Parcelable {
private static final String LOCATION = "location";
private static final String SOURCE_MAPBOX = "mapbox";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.TrafficStats;
import android.os.BatteryManager;
import android.os.Build;
import android.support.annotation.Nullable;
import android.telephony.TelephonyManager;
import android.text.TextUtils;

import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
Expand All @@ -31,9 +26,6 @@

import com.mapbox.android.core.MapboxSdkInfoForUserAgentGenerator;

import javax.net.SocketFactory;

import okhttp3.OkHttpClient;
import okio.Buffer;

import static com.mapbox.android.telemetry.MapboxTelemetryConstants.MAPBOX_SHARED_PREFERENCES;
Expand Down Expand Up @@ -300,39 +292,4 @@ static boolean adjustWakeUpMode(Context context) {
}
return false;
}

static OkHttpClient createOkHttpClientWithStrictModeWorkAround() {
return new OkHttpClient().newBuilder()
.socketFactory(new SocketFactory() {
SocketFactory socketFactory = SocketFactory.getDefault();
private static final int THREAD_ID = 10000;

@Override
public Socket createSocket(String host, int port) throws IOException, UnknownHostException {
TrafficStats.setThreadStatsTag(THREAD_ID);
return socketFactory.createSocket(host, port);
}

@Override
public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws
IOException, UnknownHostException {
TrafficStats.setThreadStatsTag(THREAD_ID);
return socketFactory.createSocket(host, port, localHost, localPort);
}

@Override
public Socket createSocket(InetAddress host, int port) throws IOException {
TrafficStats.setThreadStatsTag(THREAD_ID);
return socketFactory.createSocket(host, port);
}

@Override
public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws
IOException {
TrafficStats.setThreadStatsTag(THREAD_ID);
return socketFactory.createSocket(address, port, localAddress, localPort);
}
})
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@

import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.Keep;


import com.google.gson.annotations.SerializedName;

import java.util.HashMap;

@Keep
public class VisionEvent extends Event implements Parcelable {
public class VisionEvent extends Event implements Parcelable {
private static final String VIS_GENERAL = "vision.general";

@SerializedName("event")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.Keep;

import com.google.gson.annotations.SerializedName;

/**
* Vision object detection event v2.
*/

@Keep
public class VisionObjectDetectionEvent extends Event implements Parcelable {
static final String VIS_OBJECT_DETECTION = "vision.objectDetection";

Expand Down
Loading

0 comments on commit ff91d41

Please sign in to comment.