Skip to content

Commit 371059a

Browse files
author
Uglješa Erceg
committed
Merge pull request #135 from adjust/state_protection
State protection
2 parents 2c079dd + 7635a7d commit 371059a

File tree

10 files changed

+17
-10
lines changed

10 files changed

+17
-10
lines changed

Adjust/adjust/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ android {
88
minSdkVersion 9
99
targetSdkVersion 21
1010
versionCode 1
11-
versionName "4.0.9"
11+
versionName "4.1.0"
1212
}
1313
}
1414

Adjust/adjust/src/main/java/com/adjust/sdk/ActivityHandler.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@ public void setEnabled(boolean enabled) {
155155
}
156156

157157
this.enabled = enabled;
158-
if (activityState != null) {
158+
159+
if (activityState == null) {
160+
trackSubsessionStart();
161+
} else {
159162
activityState.enabled = enabled;
160163
writeActivityState();
161164
}
@@ -209,6 +212,10 @@ public void setOfflineMode(boolean offline) {
209212

210213
this.offline = offline;
211214

215+
if (activityState == null) {
216+
trackSubsessionStart();
217+
}
218+
212219
updateStatus(offline,
213220
"Pausing package and attribution handler to put in offline mode",
214221
"Package and attribution handler remain paused because the SDK is disabled",

Adjust/adjust/src/main/java/com/adjust/sdk/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public interface Constants {
2727
String BASE_URL = "https://app.adjust.com";
2828
String SCHEME = "https";
2929
String AUTHORITY = "app.adjust.com";
30-
String CLIENT_SDK = "android4.0.9";
30+
String CLIENT_SDK = "android4.1.0";
3131
String LOGTAG = "Adjust";
3232

3333
String ACTIVITY_STATE_FILENAME = "AdjustIoActivityState";

Adjust/example/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ dependencies {
2828
// running mvn package
2929
//compile fileTree(dir: '../target', include: ['*.jar'])
3030
// using maven repository
31-
//compile 'com.adjust.sdk:adjust-android:4.0.9'
31+
//compile 'com.adjust.sdk:adjust-android:4.1.0'
3232
}

Adjust/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<artifactId>adjust-android</artifactId>
77
<groupId>com.adjust.sdk</groupId>
8-
<version>4.0.9</version>
8+
<version>4.1.0</version>
99
<packaging>jar</packaging>
1010
<name>Adjust Android SDK</name>
1111
<url>https://github.com/adjust/android_sdk</url>

Adjust/test/src/androidTest/java/com/adjust/sdk/test/TestActivityHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ public void testDisable() {
585585
config.setLogLevel(LogLevel.ERROR);
586586

587587
// start activity handler with config
588-
ActivityHandler activityHandler = getActivityHandler(config);
588+
ActivityHandler activityHandler = ActivityHandler.getInstance(config);
589589

590590
// check that is true by default
591591
assertUtil.isTrue(activityHandler.isEnabled());

Adjust/test/src/androidTest/java/com/adjust/sdk/test/TestActivityPackage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public TestActivityPackage(ActivityPackage activityPackage) {
4747
// default values
4848
appToken = "123456789012";
4949
environment = "sandbox";
50-
clientSdk = "android4.0.9";
50+
clientSdk = "android4.1.0";
5151
suffix = "";
5252
attribution = new AdjustAttribution();
5353
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ compile project(":adjust")
5252
If you are using Maven, add this line instead:
5353

5454
```
55-
compile 'com.adjust.sdk:adjust-android:4.0.9'
55+
compile 'com.adjust.sdk:adjust-android:4.1.0'
5656
```
5757

5858
### 4. Add Google Play Services

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.9
1+
4.1.0

doc/migrate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Migrate your adjust SDK for Android to 4.0.9 from 3.6.2
1+
## Migrate your adjust SDK for Android to 4.1.0 from 3.6.2
22

33
### The Application class
44

0 commit comments

Comments
 (0)