Skip to content

Commit

Permalink
[#551] Replaced dependency by jar
Browse files Browse the repository at this point in the history
  • Loading branch information
valeria committed Dec 26, 2016
1 parent 272e76d commit 2c3764c
Show file tree
Hide file tree
Showing 17 changed files with 10 additions and 1,552 deletions.
1 change: 0 additions & 1 deletion app/build.gradle
Expand Up @@ -116,5 +116,4 @@ dependencies {
testCompile 'org.powermock:powermock-classloading-xstream:1.6.2'
androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
compile project(':sentry-android')
}
Binary file added app/libs/SentryAndroid_1.5.2.jar
Binary file not shown.
1 change: 0 additions & 1 deletion app/src/main/java/org/akvo/flow/util/ConstantUtil.java
Expand Up @@ -175,7 +175,6 @@ public class ConstantUtil {
public static final String S3_BUCKET = "awsBucket";
public static final String S3_ACCESSKEY = "awsAccessKeyId";
public static final String S3_SECRET = "awsSecretKey";
public static final String SENTRY_URL = "sentryUrl";
public static final String SENTRY_DSN = "sentryDsn";

/**
Expand Down
Expand Up @@ -17,17 +17,13 @@

package org.akvo.flow.util.logging;

import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

import com.joshdholtz.sentry.AbstractPermissionVerifier;
import com.joshdholtz.sentry.PostPermissionVerifier;

import org.akvo.flow.util.StatusUtil;

public class FlowPostPermissionVerifier extends AbstractPermissionVerifier {
public class FlowPostPermissionVerifier extends PostPermissionVerifier {

public FlowPostPermissionVerifier() {
}
Expand All @@ -43,17 +39,6 @@ public boolean shouldAttemptPost(Context context) {
//User did not allow using 3G and wifi is not connected
return false;
}
//Is the permission set in manifest?
PackageManager pm = context.getPackageManager();
int hasPerm = pm.checkPermission(Manifest.permission.ACCESS_NETWORK_STATE,
context.getPackageName());
if (hasPerm != PackageManager.PERMISSION_GRANTED) {
return false;
}
//is there a connection?
ConnectivityManager connectivityManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
return activeNetworkInfo != null && activeNetworkInfo.isConnected();
return super.shouldAttemptPost(context);
}
}
Expand Up @@ -20,12 +20,12 @@
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.os.Build;
import android.support.annotation.NonNull;
import android.text.TextUtils;

import org.akvo.flow.BuildConfig;
import org.akvo.flow.R;
import org.akvo.flow.util.ConstantUtil;
import org.akvo.flow.util.PropertyUtil;

Expand Down Expand Up @@ -78,10 +78,11 @@ public void initDebugTree() {
}

@NonNull
String getSentryDsn(PropertyUtil props) {
String getSentryDsn(Resources resources) {
final PropertyUtil props = new PropertyUtil(resources);
String sentryDsn = props.getProperty(ConstantUtil.SENTRY_DSN);
if (TextUtils.isEmpty(sentryDsn)) {
sentryDsn = context.getString(R.string.sentry_dsn);
throw new IllegalArgumentException("Missing sentry dsn");
}
return sentryDsn;
}
Expand Down
Expand Up @@ -22,7 +22,6 @@

import com.joshdholtz.sentry.Sentry;

import org.akvo.flow.util.PropertyUtil;
import org.json.JSONException;

import java.util.Map;
Expand All @@ -39,8 +38,8 @@ public SentryHelper(Context context) {
public void initSentry() {
addTags();
Sentry.setCaptureListener(new FlowSentryCaptureListener(tags));
final PropertyUtil props = new PropertyUtil(context.getResources());
String sentryDsn = getSentryDsn(props);

String sentryDsn = getSentryDsn(context.getResources());
Sentry.init(context, sentryDsn, true, new FlowPostPermissionVerifier(),
LoggingFactory.SENTRY_PROTOCOL_VERSION);
}
Expand Down
18 changes: 0 additions & 18 deletions sentry-android/.gitignore

This file was deleted.

35 changes: 0 additions & 35 deletions sentry-android/build.gradle

This file was deleted.

17 changes: 0 additions & 17 deletions sentry-android/proguard-rules.pro

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions sentry-android/src/main/AndroidManifest.xml

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 2c3764c

Please sign in to comment.