Skip to content

Commit

Permalink
feat: 3.5.3 snapshot; AndroidIdEnabled = false
Browse files Browse the repository at this point in the history
  • Loading branch information
cpacm committed Dec 1, 2023
1 parent 4d29c4f commit d1f403f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ buildscript {
]

releaseConfiguration = [
releaseVersion : "3.5.3",
releaseVersion : "3.5.3-SNAPSHOT",
releaseVersionCode: 30503,

pluginVersion : "3.5.2"
pluginVersion : "3.5.3"
]

versions = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public class CoreConfiguration implements Configurable {

private boolean mImeiEnabled = false;

private boolean mAndroidIdEnabled = false;

public CoreConfiguration(String projectId, String urlScheme) {
mProjectId = projectId;
mUrlScheme = urlScheme;
Expand Down Expand Up @@ -189,4 +191,13 @@ public CoreConfiguration setImeiEnabled(boolean mImeiEnabled) {
this.mImeiEnabled = mImeiEnabled;
return this;
}

public boolean isAndroidIdEnabled() {
return mAndroidIdEnabled;
}

public CoreConfiguration setAndroidIdEnabled(boolean androidIdEnabled) {
this.mAndroidIdEnabled = androidIdEnabled;
return this;

Check warning on line 201 in growingio-tracker-core/src/main/java/com/growingio/android/sdk/CoreConfiguration.java

View check run for this annotation

Codecov / codecov/patch

growingio-tracker-core/src/main/java/com/growingio/android/sdk/CoreConfiguration.java#L200-L201

Added lines #L200 - L201 were not covered by tests
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public String getImei() {

public String getAndroidId() {
// ensure androidid call once in a process
if (TextUtils.isEmpty(mAndroidId)) {
if (TextUtils.isEmpty(mAndroidId) && ConfigurationProvider.core().isAndroidIdEnabled()) {
try {
mAndroidId = Settings.System.getString(getContext().getContentResolver(), Settings.System.ANDROID_ID);
if (TextUtils.isEmpty(mAndroidId) || MAGIC_ANDROID_ID.equals(mAndroidId)) {
Expand All @@ -151,7 +151,7 @@ public String getAndroidId() {
mAndroidId = MAGIC_ANDROID_ID;
}
}
return mAndroidId.equals(MAGIC_ANDROID_ID) ? null : mAndroidId;
return MAGIC_ANDROID_ID.equals(mAndroidId) ? null : mAndroidId;
}

public String getOaid() {
Expand Down

0 comments on commit d1f403f

Please sign in to comment.