-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## [5.0.0] - 2023-08-03 ### Added: - Added Automatic Mobile Environment Attributes functionality which makes it simpler to target your mobile customers based on application name or version, or on device characteristics including manufacturer, model, operating system, locale, and so on. To learn more, read [Automatic environment attributes](https://docs.launchdarkly.com/sdk/features/environment-attributes). ### Removed - Removed LDUser and related functionality. Use LDContext instead. To learn more, read https://docs.launchdarkly.com/home/contexts. --------- Co-authored-by: Ember Stevens <[email protected]> Co-authored-by: Ember Stevens <[email protected]> Co-authored-by: Todd Anderson <[email protected]> Co-authored-by: tanderson-ld <[email protected]> Co-authored-by: ld-repository-standards[bot] <113625520+ld-repository-standards[bot]@users.noreply.github.com> Co-authored-by: Kane Parkinson <[email protected]> Co-authored-by: LaunchDarklyReleaseBot <[email protected]>
- Loading branch information
1 parent
1df1abc
commit 1d5a835
Showing
57 changed files
with
1,427 additions
and
550 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...sdk/src/androidTest/java/com/launchdarkly/sdk/android/EnvironmentReporterBuilderTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.launchdarkly.sdk.android; | ||
|
||
import android.app.Application; | ||
|
||
import androidx.test.core.app.ApplicationProvider; | ||
import androidx.test.ext.junit.runners.AndroidJUnit4; | ||
|
||
import com.launchdarkly.sdk.android.env.EnvironmentReporterBuilder; | ||
import com.launchdarkly.sdk.android.env.IEnvironmentReporter; | ||
import com.launchdarkly.sdk.android.integrations.ApplicationInfoBuilder; | ||
import com.launchdarkly.sdk.android.subsystems.ApplicationInfo; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
public class EnvironmentReporterBuilderTest { | ||
|
||
/** | ||
* Requirement 1.2.5.2 - Prioritized sourcing application info attributes | ||
*/ | ||
@Test | ||
public void prioritizesProvidedApplicationInfo() { | ||
|
||
Application application = ApplicationProvider.getApplicationContext(); | ||
EnvironmentReporterBuilder builder1 = new EnvironmentReporterBuilder(); | ||
builder1.enableCollectionFromPlatform(application); | ||
IEnvironmentReporter reporter1 = builder1.build(); | ||
ApplicationInfo reporter1Output = reporter1.getApplicationInfo(); | ||
|
||
EnvironmentReporterBuilder builder2 = new EnvironmentReporterBuilder(); | ||
ApplicationInfo manualInfoInput = new ApplicationInfoBuilder().applicationId("manualAppID").createApplicationInfo(); | ||
builder2.setApplicationInfo(manualInfoInput); | ||
builder2.enableCollectionFromPlatform(application); | ||
IEnvironmentReporter reporter2 = builder2.build(); | ||
ApplicationInfo reporter2Output = reporter2.getApplicationInfo(); | ||
|
||
Assert.assertNotEquals(reporter1Output.getApplicationId(), reporter2Output.getApplicationId()); | ||
Assert.assertEquals(manualInfoInput.getApplicationId(), reporter2Output.getApplicationId()); | ||
} | ||
|
||
@Test | ||
public void defaultsToSDKValues() { | ||
IEnvironmentReporter reporter = new EnvironmentReporterBuilder().build(); | ||
Assert.assertEquals(LDPackageConsts.SDK_NAME, reporter.getApplicationInfo().getApplicationId()); | ||
Assert.assertEquals(LDPackageConsts.SDK_NAME, reporter.getApplicationInfo().getApplicationName()); | ||
Assert.assertEquals(BuildConfig.VERSION_NAME, reporter.getApplicationInfo().getApplicationVersion()); | ||
Assert.assertEquals(BuildConfig.VERSION_NAME, reporter.getApplicationInfo().getApplicationVersionName()); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.