Skip to content

Commit

Permalink
Release 1.6.37
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzhzh committed Feb 24, 2017
1 parent 8a61956 commit 76ab0f0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 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.36"
version = "1.6.37"

android {
compileSdkVersion 21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ public void enqueueEventMessage(final String type, final JSONObject eventJson) {
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 {
if (SensorsDataUtils.isNetworkAvailable(mContext)) {
if (SensorsDataUtils.isNetworkAvailable(mContext)) {
if (SensorsDataAPI.sharedInstance(mContext).isDebugMode() || ret ==
DbAdapter.DB_OUT_OF_MEMORY_ERROR) {
mWorker.runMessage(m);
} else {
// track_signup 立即发送
if (type.equals("track_signup") || ret > SensorsDataAPI.sharedInstance(mContext)
.getFlushBulkSize()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.DisplayMetrics;
Expand Down Expand Up @@ -229,6 +226,11 @@ boolean isDebugWriteData() {
deviceInfo.put("$carrier", "其他");
}
}

// String androidID = SensorsDataUtils.getAndroidID(mContext);
// if (!TextUtils.isEmpty(androidID)) {
// deviceInfo.put("$device_id", androidID);
// }
}

mDeviceInfo = Collections.unmodifiableMap(deviceInfo);
Expand Down Expand Up @@ -1373,6 +1375,12 @@ public void onActivityStarted(Activity activity) {
mFirstStart.commit(false);
}

try {
appBecomeActive();
} catch (Exception e) {
e.printStackTrace();
}

if (mAutoTrack) {
try {
JSONObject properties = new JSONObject();
Expand Down Expand Up @@ -1462,6 +1470,12 @@ public void onActivityStopped(Activity activity) {
startedActivityCount = startedActivityCount - 1;

if (startedActivityCount == 0) {
try {
appEnterBackground();
} catch (Exception e) {
e.printStackTrace();
}

if (mAutoTrack) {
try {
track("$AppEnd");
Expand Down Expand Up @@ -1681,7 +1695,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.36";
static final String VERSION = "1.6.37";

static Boolean ENABLE_LOG = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,6 @@ public void onActivityResumed(Activity activity) {

mStartedActivities.add(activity);

if (mStartedActivities.size() == 1) {
SensorsDataAPI.sharedInstance(mContext).appBecomeActive();
}

for (String className : mDisabledActivity) {
if (className.equals(activity.getClass().getCanonicalName())) {
return;
Expand All @@ -223,9 +219,7 @@ public void onActivityPaused(Activity activity) {

@Override
public void onActivityStopped(Activity activity) {
if (mStartedActivities.size() == 0) {
SensorsDataAPI.sharedInstance(mContext).appEnterBackground();
}

}

@Override
Expand Down

0 comments on commit 76ab0f0

Please sign in to comment.