diff --git a/SensorsAnalyticsSDK/SensorsAnalyticsSDK/build.gradle b/SensorsAnalyticsSDK/SensorsAnalyticsSDK/build.gradle index 05222f84..0176cd4f 100644 --- a/SensorsAnalyticsSDK/SensorsAnalyticsSDK/build.gradle +++ b/SensorsAnalyticsSDK/SensorsAnalyticsSDK/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' apply plugin: 'com.jfrog.bintray' -version = "1.6.19" +version = "1.6.20" android { compileSdkVersion 21 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 b0de1661..a6a758c3 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 @@ -429,6 +429,7 @@ public void enableAutoTrack() { * @param isSupportJellyBean 是否支持API level 16及以下的版本。 * 因为API level 16及以下的版本, addJavascriptInterface有安全漏洞,请谨慎使用 */ + @Deprecated @SuppressLint(value = {"SetJavaScriptEnabled", "addJavascriptInterface"}) public void showUpWebView(WebView webView, boolean isSupportJellyBean) { showUpWebView(webView, isSupportJellyBean, null); @@ -1254,18 +1255,17 @@ public void onActivityStopped(Activity activity) { synchronized (startedActivityCount) { startedActivityCount = startedActivityCount - 1; - if (mAutoTrack) { - if (startedActivityCount == 0) { + if (startedActivityCount == 0) { + if (mAutoTrack) { try { track("$AppEnd"); } catch (Exception e) { Log.w(LOGTAG, e); } } + mMessages.flush(); } } - - mMessages.flush(); } @Override @@ -1404,7 +1404,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.19"; + static final String VERSION = "1.6.20"; static Boolean ENABLE_LOG = false; diff --git a/SensorsAnalyticsSDK/SensorsAnalyticsSDK/src/main/java/com/sensorsdata/analytics/android/sdk/util/SensorsDataUtils.java b/SensorsAnalyticsSDK/SensorsAnalyticsSDK/src/main/java/com/sensorsdata/analytics/android/sdk/util/SensorsDataUtils.java index 790c9d88..db06b483 100644 --- a/SensorsAnalyticsSDK/SensorsAnalyticsSDK/src/main/java/com/sensorsdata/analytics/android/sdk/util/SensorsDataUtils.java +++ b/SensorsAnalyticsSDK/SensorsAnalyticsSDK/src/main/java/com/sensorsdata/analytics/android/sdk/util/SensorsDataUtils.java @@ -73,6 +73,8 @@ public static String networkType(Context context) { case TelephonyManager.NETWORK_TYPE_GPRS: case TelephonyManager.NETWORK_TYPE_EDGE: case TelephonyManager.NETWORK_TYPE_CDMA: + case TelephonyManager.NETWORK_TYPE_1xRTT: + case TelephonyManager.NETWORK_TYPE_IDEN: return "2G"; case TelephonyManager.NETWORK_TYPE_UMTS: case TelephonyManager.NETWORK_TYPE_EVDO_0: