Skip to content

Commit

Permalink
chore(release): pulling release/1.21.2 into master
Browse files Browse the repository at this point in the history
chore(release): pulling release/1.21.2 into master
  • Loading branch information
itsdebs authored Jan 29, 2024
2 parents 9a4c1f5 + 704b6d7 commit 14acedd
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 44 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.21.2](https://github.com/rudderlabs/rudder-sdk-android/compare/v1.21.1...v1.21.2) (2024-01-25)


### Bug Fixes

* added synchronization to RudderContext ([#372](https://github.com/rudderlabs/rudder-sdk-android/issues/372)) ([ad9baa0](https://github.com/rudderlabs/rudder-sdk-android/commit/ad9baa07ab5685a82c9b6822e01824db227642a3))

### [1.21.1](https://github.com/rudderlabs/rudder-sdk-android/compare/v1.21.0...v1.21.1) (2023-12-13)


Expand Down
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

44 changes: 44 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
### Elastic License 2.0 (ELv2) ###

## Acceptance ##
By using the software, you agree to all of the terms and conditions below.

## Copyright License ##
The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below

## Limitations ##
You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.

You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.

You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.

## Patents ##
The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.

## Notices ##
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.

If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.

## No Other Rights ##
These terms do not imply any licenses other than those expressly granted in these terms.

## Termination ##
If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.

## No Liability ##
As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.

## Definitions ##
The *licensor* is the entity offering these terms, and the *software* is the software the licensor makes available under these terms, including any portion of it.

*you* refers to the individual or entity agreeing to these terms.

*your company* is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. *control* means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.

*your licenses* are all the licenses granted to you for the software under these terms.

*use* means anything you do with the software requiring one of your licenses.

*trademark* means trademarks, service marks, and similar rights.
29 changes: 19 additions & 10 deletions core/src/main/java/com/rudderstack/android/sdk/core/RudderApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,39 @@

class RudderApp {
@SerializedName("build")
private String build;
private final String build;
@SerializedName("name")
private String name;
private final String name;
@SerializedName("namespace")
private String nameSpace;
private final String nameSpace;
@SerializedName("version")
private String version;
private final String version;

// internal constructor
// to be used while creating a cache of context
RudderApp(Application application) {
String buildValue = null;
String nameValue = null;
String nameSpaceValue = null;
String versionValue = null;
try {
String packageName = application.getPackageName();
PackageManager packageManager = application.getPackageManager();
PackageInfo packageInfo = packageManager.getPackageInfo(packageName, 0);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
this.build = Long.toString(packageInfo.getLongVersionCode());
else this.build = Integer.toString(packageInfo.versionCode);
this.name = packageInfo.applicationInfo.loadLabel(packageManager).toString();
this.nameSpace = packageName;
this.version = packageInfo.versionName;
buildValue = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)?
Long.toString(packageInfo.getLongVersionCode()): Integer.toString(packageInfo.versionCode);
nameValue = packageInfo.applicationInfo.loadLabel(packageManager).toString();
nameSpaceValue = packageName;
versionValue = packageInfo.versionName;
} catch (PackageManager.NameNotFoundException ex) {
ReportManager.reportError(ex);
RudderLogger.logError(ex.getCause());
}
finally {
this.build = buildValue;
this.name = nameValue;
this.nameSpace = nameSpaceValue;
this.version = versionValue;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class RudderClient {
private static RudderOption defaultOptions;
private static String deviceToken;
private static String authToken;
private static ReentrantLock reentrantLock = new ReentrantLock();
private static final ReentrantLock reentrantLock = new ReentrantLock();


private static final int NUMBER_OF_FLUSH_CALLS_IN_QUEUE = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ public class RudderContext {
void resetTraits() {
RudderTraits traits = new RudderTraits();
// convert the whole traits to map and take care of the extras
this.traits = Utils.convertToMap(RudderGson.getInstance().toJson(traits));
synchronized (this) {
this.traits = Utils.convertToMap(RudderGson.getInstance().toJson(traits));
}
}

void updateTraits(RudderTraits traits) {
Expand All @@ -135,13 +137,17 @@ void updateTraits(RudderTraits traits) {

// If a user is already loggedIn and then a new user tries to login
if (existingId != null && newId != null && !existingId.equals(newId)) {
this.traits = traitsMap;
synchronized (this) {
this.traits = traitsMap;
}
resetExternalIds();
return;
}

// update traits object here
this.traits.putAll(traitsMap);
synchronized (this) {
this.traits.putAll(traitsMap);
}

}

Expand All @@ -154,7 +160,9 @@ void persistTraits() {
try {
if (RudderClient.getApplication() != null) {
RudderPreferenceManager preferenceManger = RudderPreferenceManager.getInstance(RudderClient.getApplication());
preferenceManger.saveTraits(RudderGson.getInstance().toJson(this.traits));
synchronized (this) {
preferenceManger.saveTraits(RudderGson.getInstance().toJson(this.traits));
}
}
} catch (NullPointerException ex) {
ReportManager.reportError(ex);
Expand Down Expand Up @@ -386,7 +394,9 @@ RudderContext copy() {

copy.app = this.app;
if (this.traits != null) {
copy.traits = new HashMap<>(this.traits);
synchronized (this) {
copy.traits = new HashMap<>(this.traits);
}
}
copy.libraryInfo = this.libraryInfo;
copy.osInfo = this.osInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class RudderLibraryInfo {
@SerializedName("name")
private String name = BuildConfig.LIBRARY_PACKAGE_NAME;
private final String name = BuildConfig.LIBRARY_PACKAGE_NAME;
@SerializedName("version")
private String version = BuildConfig.VERSION_NAME;
private final String version = BuildConfig.VERSION_NAME;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class RudderOSInfo {
@SerializedName("name")
private String name = "Android";
private final String name = "Android";
@SerializedName("version")
private String version = Build.VERSION.RELEASE;
private final String version = Build.VERSION.RELEASE;
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ android.enableJetifier=true
android.enableR8.fullMode=true
kotlin.code.style=official
GROUP=com.rudderstack.android.sdk
VERSION_CODE=23
VERSION_NAME=1.21.1
VERSION_CODE=24
VERSION_NAME=1.21.2
POM_NAME=Rudderstack SDK for android
POM_DESCRIPTION=Rudderstack SDK for android
POM_ARTIFACT_ID=core
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.21.1",
"version": "1.21.2",
"dependencies": {
"properties-reader": "^2.2.0"
}
Expand Down

0 comments on commit 14acedd

Please sign in to comment.