Skip to content

Commit

Permalink
Release 1.6.16
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzhzh committed Sep 30, 2016
1 parent 161dc77 commit 031abb0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 28 deletions.
2 changes: 1 addition & 1 deletion SensorsAnalyticsSDK/SensorsAnalyticsSDK/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

version = "1.6.15"
version = "1.6.16"

android {
compileSdkVersion 21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,36 +70,40 @@ public static AnalyticsMessages getInstance(final Context messageContext, final
}

public void enqueueEventMessage(final String type, final JSONObject eventJson) {
synchronized (mDbAdapter) {
int ret = mDbAdapter.addJSON(eventJson, DbAdapter.Table.EVENTS);
if (ret < 0) {
String error = "Failed to enqueue the event: " + eventJson;
if (SensorsDataAPI.sharedInstance(mContext).isDebugMode()) {
throw new DebugModeException(error);
} else {
Log.w(LOGTAG, error);
try {
synchronized (mDbAdapter) {
int ret = mDbAdapter.addJSON(eventJson, DbAdapter.Table.EVENTS);
if (ret < 0) {
String error = "Failed to enqueue the event: " + eventJson;
if (SensorsDataAPI.sharedInstance(mContext).isDebugMode()) {
throw new DebugModeException(error);
} else {
Log.w(LOGTAG, error);
}
}
}

final Message m = Message.obtain();
m.what = FLUSH_QUEUE;
final Message m = Message.obtain();
m.what = FLUSH_QUEUE;

if (SensorsDataAPI.sharedInstance(mContext).isDebugMode() || ret ==
DbAdapter.DB_OUT_OF_MEMORY_ERROR) {
mWorker.runMessage(m);
} else {
String networkType = SensorsDataUtils.networkType(mContext);
if (networkType.equals("WIFI") || networkType.equals("3G") || networkType.equals("4G")) {
// track_signup 立即发送
if (type.equals("track_signup") || ret > SensorsDataAPI.sharedInstance(mContext)
.getFlushBulkSize()) {
mWorker.runMessage(m);
} else {
final int interval = SensorsDataAPI.sharedInstance(mContext).getFlushInterval();
mWorker.runMessageOnce(m, interval);
if (SensorsDataAPI.sharedInstance(mContext).isDebugMode() || ret ==
DbAdapter.DB_OUT_OF_MEMORY_ERROR) {
mWorker.runMessage(m);
} else {
String networkType = SensorsDataUtils.networkType(mContext);
if (networkType.equals("WIFI") || networkType.equals("3G") || networkType.equals("4G")) {
// track_signup 立即发送
if (type.equals("track_signup") || ret > SensorsDataAPI.sharedInstance(mContext)
.getFlushBulkSize()) {
mWorker.runMessage(m);
} else {
final int interval = SensorsDataAPI.sharedInstance(mContext).getFlushInterval();
mWorker.runMessageOnce(m, interval);
}
}
}
}
} catch (Exception e) {
Log.w(LOGTAG, "enqueueEventMessage error:" + e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ public void onActivityResumed(Activity activity) {
} else {
track("$AppViewScreen", properties);
}
} catch (InvalidDataException | JSONException e) {
} catch (Exception e) {
Log.w(LOGTAG, e);
}
}
Expand All @@ -1240,7 +1240,7 @@ public void onActivityStopped(Activity activity) {
.getCanonicalName())) {
try {
track("$AppEnd");
} catch (InvalidDataException e) {
} catch (Exception e) {
Log.w(LOGTAG, e);
}
}
Expand Down Expand Up @@ -1384,7 +1384,7 @@ private static void mergeJSONObject(final JSONObject source, JSONObject dest)
static final int VTRACK_SUPPORTED_MIN_API = 16;

// SDK版本
static final String VERSION = "1.6.15";
static final String VERSION = "1.6.16";

static Boolean ENABLE_LOG = false;

Expand Down

0 comments on commit 031abb0

Please sign in to comment.