From fd4a619f53d92120a70ccef33b50ba5b6c1364c5 Mon Sep 17 00:00:00 2001 From: wangzhuozhou Date: Fri, 24 Mar 2017 19:41:40 +0800 Subject: [PATCH] Release 1.6.39 --- .../SensorsAnalyticsSDK/build.gradle | 4 ++-- .../android/sdk/AnalyticsMessages.java | 23 +++++++++++-------- .../analytics/android/sdk/SensorsDataAPI.java | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/SensorsAnalyticsSDK/SensorsAnalyticsSDK/build.gradle b/SensorsAnalyticsSDK/SensorsAnalyticsSDK/build.gradle index 911e18c4..2fac153b 100644 --- a/SensorsAnalyticsSDK/SensorsAnalyticsSDK/build.gradle +++ b/SensorsAnalyticsSDK/SensorsAnalyticsSDK/build.gradle @@ -3,11 +3,11 @@ apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' apply plugin: 'com.jfrog.bintray' -version = "1.6.38" +version = "1.6.39" android { compileSdkVersion 21 - buildToolsVersion "21.0.0" + buildToolsVersion "25.0.2" resourcePrefix "sensors_analytics_" diff --git a/SensorsAnalyticsSDK/SensorsAnalyticsSDK/src/main/java/com/sensorsdata/analytics/android/sdk/AnalyticsMessages.java b/SensorsAnalyticsSDK/SensorsAnalyticsSDK/src/main/java/com/sensorsdata/analytics/android/sdk/AnalyticsMessages.java index d26f8c55..b6c427e2 100644 --- a/SensorsAnalyticsSDK/SensorsAnalyticsSDK/src/main/java/com/sensorsdata/analytics/android/sdk/AnalyticsMessages.java +++ b/SensorsAnalyticsSDK/SensorsAnalyticsSDK/src/main/java/com/sensorsdata/analytics/android/sdk/AnalyticsMessages.java @@ -117,16 +117,10 @@ public void checkConfigure(final DecideMessages check) { } public void flush() { - try { - if (SensorsDataUtils.isNetworkAvailable(mContext)) { - final Message m = Message.obtain(); - m.what = FLUSH_QUEUE; + final Message m = Message.obtain(); + m.what = FLUSH_QUEUE; - mWorker.runMessage(m); - } - } catch (Exception e) { - e.printStackTrace(); - } + mWorker.runMessage(m); } private byte[] slurp(final InputStream inputStream) @@ -145,6 +139,13 @@ private byte[] slurp(final InputStream inputStream) } public void sendData() { + try { + if (!SensorsDataUtils.isNetworkAvailable(mContext)) { + return; + } + } catch (Exception e) { + e.printStackTrace(); + } int count = 100; Toast toast = null; while (count > 0) { @@ -265,7 +266,7 @@ public void sendData() { if (toast != null) { toast.cancel(); } - toast = Toast.makeText(mContext, errorMessage, Toast.LENGTH_LONG); + toast = Toast.makeText(mContext, errorMessage, Toast.LENGTH_SHORT); toast.show(); } catch (Exception e) { e.printStackTrace(); @@ -279,6 +280,8 @@ public void sendData() { if (isDebugMode || SensorsDataAPI.ENABLE_LOG) { Log.i(LOGTAG, String.format("Events flushed. [left = %d]", count)); } + } else { + count = 0; } if (null != bout) try { diff --git a/SensorsAnalyticsSDK/SensorsAnalyticsSDK/src/main/java/com/sensorsdata/analytics/android/sdk/SensorsDataAPI.java b/SensorsAnalyticsSDK/SensorsAnalyticsSDK/src/main/java/com/sensorsdata/analytics/android/sdk/SensorsDataAPI.java index 2f511893..187c06fa 100644 --- a/SensorsAnalyticsSDK/SensorsAnalyticsSDK/src/main/java/com/sensorsdata/analytics/android/sdk/SensorsDataAPI.java +++ b/SensorsAnalyticsSDK/SensorsAnalyticsSDK/src/main/java/com/sensorsdata/analytics/android/sdk/SensorsDataAPI.java @@ -1693,7 +1693,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.38"; + static final String VERSION = "1.6.39"; static Boolean ENABLE_LOG = false;