Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare 3.6.0 release #207

Merged
merged 334 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
334 commits
Select commit Hold shift + click to select a range
c654453
Revert to old String behavior for allFlags, initialize WeakReference …
gwhelanLD Feb 22, 2019
19a9401
Merge branch 'gw/ch29266/flagstore' into eb/ch31891/variation-detail
eli-darkly Feb 22, 2019
69c1c9b
Better implementation of EvaluationReason serialization type adapter.
gwhelanLD Feb 26, 2019
23fd36a
Revert "Better implementation of EvaluationReason serialization type
gwhelanLD Feb 26, 2019
becd7e5
Gw/ch29266/flagstore (#105)
gwhelanLD Feb 26, 2019
76f4650
Return json flags as JsonElement in allFlags map. (#106)
gwhelanLD Feb 26, 2019
c246a27
Merge branch 'next-release' into eb/ch31891/variation-detail
eli-darkly Feb 27, 2019
54ac5cf
Bump ok-http version to 3.9.1 (#107)
gwhelanLD Mar 1, 2019
8e36a32
fix annotations so eval reasons are serialized in events
eli-darkly Mar 2, 2019
85a5adf
Merge pull request #104 from launchdarkly/eb/ch31891/variation-detail
eli-darkly Mar 2, 2019
84ecc29
fix/expand doc comments for public methods
eli-darkly Mar 5, 2019
46948c0
typo
eli-darkly Mar 5, 2019
192e4da
typo
eli-darkly Mar 5, 2019
1a7f34b
Merge pull request #108 from launchdarkly/eb/ch33404/doc-comments
eli-darkly Mar 5, 2019
ea73393
add version string getter method
eli-darkly Mar 6, 2019
12fcfe1
Merge pull request #109 from launchdarkly/eb/ch33470/version-getter
eli-darkly Mar 6, 2019
723363d
Check for null key before file comparison check. (#110)
gwhelanLD Mar 8, 2019
2e6a5bf
[ch33658] Add unsafeReset() for LDClient testing re-initialization (#…
gwhelanLD Mar 12, 2019
7ca817e
[ch33846] Rename tests to not start with capitals and general refacto…
gwhelanLD Mar 12, 2019
071bfb5
Add documentation for flagstore implementation (#113)
gwhelanLD Mar 13, 2019
cf593d8
Merge branch 'master' into next-release
eli-darkly Mar 13, 2019
3777e9d
[ch35150] Unit tests and bug fixes (#114)
gwhelanLD Mar 28, 2019
77eff6f
Add compatibility behavior to stringVariation and allFlags methods. (…
gwhelanLD Mar 28, 2019
6606fa9
Merge branch 'master' of github.com:launchdarkly/android-client into …
gwhelanLD Apr 11, 2019
26ac3ee
Update LDUser not to store all fields as Json. (#116)
gwhelanLD Apr 11, 2019
4e76a48
Add metricValue field to CustomEvent, add overloaded track method for…
gwhelanLD Apr 19, 2019
c1e7510
Merge branch 'master' into next-release
gwhelanLD Apr 23, 2019
5cca201
[ch37794] Run connected emulator tests in CircleCI (#120)
gwhelanLD Apr 29, 2019
496fc69
[ch34533] connection status, removing guava, network restructuring. (…
gwhelanLD Apr 29, 2019
2215275
rename repo and package name and apply markdown templates (#121)
bwoskow-ld Apr 30, 2019
fdede38
Fix issue that stream could be started before stopping when calling i…
gwhelanLD May 2, 2019
697d870
Merge branch 'master' into next-release
gwhelanLD May 2, 2019
0849812
Revert "Fix issue that stream could be started before stopping when c…
bwoskow-ld May 3, 2019
bbbeb81
Revert "rename repo and package name and apply markdown templates (#1…
bwoskow-ld May 3, 2019
146ba99
Revert "Revert "Fix issue that stream could be started before stoppin…
bwoskow-ld May 3, 2019
330e2e2
Revert "Revert "rename repo and package name and apply markdown templ…
bwoskow-ld May 3, 2019
f202096
Merge branch 'master' of github.com:launchdarkly/android-client-sdk-p…
bwoskow-ld May 3, 2019
466318b
Merge branch 'master' into next-release
bwoskow-ld May 6, 2019
6f90344
Merge branch 'master' into next-release
bwoskow-ld May 6, 2019
e49b5f8
Fix thread leak on identify call from restarting EventProcessor witho…
gwhelanLD May 14, 2019
2e2e1a1
Merge branch 'master' into next-release
gwhelanLD May 21, 2019
d458246
Add top level try/catch to migration methods. Check flag version Shar…
gwhelanLD May 21, 2019
0f39494
Merge branch 'master' into next-release
gwhelanLD May 22, 2019
b6852af
Update Throttler to call runnable on background thread. (#125)
gwhelanLD Jun 14, 2019
c32e62b
Fix ConcurrentModificationException of instance map (#126)
gwhelanLD Jun 14, 2019
7ea8f8d
Merge branch 'master' into next-release
gwhelanLD Jun 14, 2019
2fb3e78
adding a circleci badge to the readme (#127)
bwoskow-ld Jul 5, 2019
bf50576
Fix bug where `stop` in StreamUpdateProcessor could not call it's lis…
gwhelanLD Jul 29, 2019
75ac7cf
Change LDAwaitFuture to not treat zero timeout as unlimited timeout
gwhelanLD Jul 29, 2019
d26e006
Merge branch 'master' into next-release
gwhelanLD Jul 29, 2019
3ac167f
Merge remote-tracking branch 'remotes/origin/experiment' into next-re…
gwhelanLD Sep 23, 2019
857451d
Revert "Merge remote-tracking branch 'remotes/origin/experiment' into…
gwhelanLD Oct 2, 2019
5088361
CircleCI fixes (#131)
gwhelanLD Oct 3, 2019
de0d059
Better ci fix (#132)
gwhelanLD Oct 7, 2019
56464a1
Speedup tests by building on macOS (#137)
gwhelanLD Oct 16, 2019
b653664
Background identify fixes (#133)
gwhelanLD Oct 16, 2019
6143d48
Experimentation 1.5 updates (#134)
gwhelanLD Oct 25, 2019
c9837e9
add entire compile-time classpath to javadoc classpath
eli-darkly Nov 14, 2019
17aee4a
javadoc fixes: <p/> is not a thing
eli-darkly Nov 14, 2019
05c2bc3
do fail on javadoc errors
eli-darkly Nov 14, 2019
bc68267
add javadoc step, misc CI cleanup
eli-darkly Nov 14, 2019
73e10da
misc javadoc fixes
eli-darkly Nov 14, 2019
8779723
Merge pull request #138 from launchdarkly/eb/ch56106/javadoc
eli-darkly Nov 14, 2019
f90b00d
remove unintentional(?) immediate event flush; clean up event tests
eli-darkly Nov 14, 2019
b1d45b9
remove unreliable test assumption about elapsed time
eli-darkly Nov 14, 2019
d1af310
Merge pull request #139 from launchdarkly/eb/ch56105/event-flush-tests
eli-darkly Nov 14, 2019
c0e71ae
[ch57098] Deprecate LDCountryCode (#141)
gwhelanLD Nov 25, 2019
ea19a16
Catch `SecurityException` when setting alarm in case there are alread…
gwhelanLD Dec 9, 2019
23b930f
Revert "[ch57098] Deprecate LDCountryCode (#141)" so we can do a patc…
gwhelanLD Jan 3, 2020
df8c273
Merge branch 'master' of github.com:launchdarkly/android-client-sdk
gwhelanLD Jan 3, 2020
7dd0e39
Revert "Revert "[ch57098] Deprecate LDCountryCode (#141)" so we can d…
gwhelanLD Jan 3, 2020
8519f7b
Deprecate public classes (#145)
gwhelanLD Jan 10, 2020
b598051
[ch61092] Add event payload ID. (#147)
gwhelanLD Jan 16, 2020
8ac37f0
Add event retry. (#149)
gwhelanLD Jan 24, 2020
c6dbf6f
Merge branch 'next-release'
gwhelanLD Jan 30, 2020
89f6e14
Fix javadoc comment for release.
gwhelanLD Jan 30, 2020
59169e1
Fix broken merge.
gwhelanLD Jan 30, 2020
f8d8da9
Merge branch 'master' of github.com:launchdarkly/android-client-sdk
gwhelanLD Jan 30, 2020
86989e9
[ch65133] Deprecate classes (#150)
gwhelanLD Feb 11, 2020
b99a268
Improve Javadoc and reduce interface clutter. (#152)
gwhelanLD Feb 12, 2020
4082207
Save Javadoc artifact and include logcat in circle output with tee. (…
gwhelanLD Feb 12, 2020
4f50176
[ch62120] Background during identify callback (#154)
gwhelanLD Feb 18, 2020
3de7975
[ch65914] Diagnostic events (#156)
gwhelanLD Feb 28, 2020
059dd08
Merge branch 'master' of github.com:launchdarkly/android-client-sdk
gwhelanLD Feb 28, 2020
1e29a82
[ch65352] Expose LDValue rather than Gson types (#158)
gwhelanLD Mar 13, 2020
b62a377
Remove SET_ALARM permission. The comment that this was required for b…
gwhelanLD Mar 20, 2020
e97a2d1
Fix minimum diagnostic recording interval comment. (#160)
gwhelanLD Mar 20, 2020
dfb8fed
Data since date was not getting reset after each periodic diagnostic …
gwhelanLD Mar 20, 2020
c06c619
[ch75315] Add maxCachedUsers configuration option (#162)
gwhelanLD May 27, 2020
1a49d7e
Configure okhttp cache for polling requests to be stored in a subdire…
gwhelanLD May 28, 2020
b2583c5
Fixes ch76614 and add test of null fallback unknown flag event genera…
gwhelanLD May 28, 2020
60ba2c3
Removing ldvalue changes before release (#165)
gwhelanLD May 29, 2020
644afee
Merge branch 'master' of github.com:launchdarkly/android-client-sdk
gwhelanLD May 29, 2020
c1106f0
[ch69437] Support for setting additional headers to be included in re…
gwhelanLD Aug 5, 2020
15025f5
Merge remote-tracking branch 'public/master' into master
gwhelanLD Aug 7, 2020
7143459
[ch89933] Improve resiliency of store for summary events. (#167)
gwhelanLD Sep 17, 2020
8f32137
[ch94053] Improve throttler behavior. (#169)
gwhelanLD Nov 14, 2020
cebcaec
Add doubleVariation, doubleVariationDetail. (#171)
gwhelanLD Dec 4, 2020
325ac9e
Provide pollUri configuration and deprecate baseUri. (#172)
gwhelanLD Dec 4, 2020
32c5288
Fix throttler behavior to ensure attempt count resets are not cancell…
gwhelanLD Dec 18, 2020
c9ecc2b
Merge remote-tracking branch 'public/master'
gwhelanLD Dec 18, 2020
2567262
[ch98336] Broaden catch statement on scheduling polling alarm (#181)
gwhelanLD Jan 13, 2021
f3a2119
Merge remote-tracking branch 'public/master'
gwhelanLD Jan 14, 2021
202ed86
Removed the guides link
bwoskow-ld Feb 3, 2021
33f56b2
Include flag key in warning message when converting a json flag to a …
apache-hb Feb 23, 2021
aa6ba29
Merge remote-tracking branch 'public/master'
gwhelanLD May 7, 2021
0ffc1ff
Merge remote-tracking branch 'public/2.x' into 2.x
gwhelanLD Jun 2, 2021
505e8d2
(2.x) Prevent NullPointerException when diagnostic processor shut dow…
gwhelanLD Jun 2, 2021
30c10e5
Release 2.14.2 (#130)
gwhelanLD Jun 2, 2021
266099d
Merge remote-tracking branch 'public/2.x' into 2.x
gwhelanLD Jun 2, 2021
ba2aabc
Bump version and update changelog for release.
gwhelanLD Jun 2, 2021
55af88f
Merge branch '2.x'
gwhelanLD Jun 2, 2021
11983c6
Explicitly specify android:exported attribute on manifest receivers. …
gwhelanLD Jun 15, 2021
fbbe20c
Update java common (#212)
gwhelanLD Jun 16, 2021
0a8920f
Merge remote-tracking branch 'public/master'
gwhelanLD Jun 25, 2021
47776a2
Flag PendingIntent on new enough platforms as the flag is required on…
gwhelanLD Jul 14, 2021
393d131
Add try for getting network capabilities (#214)
gwhelanLD Jul 14, 2021
782c1fc
Merge remote-tracking branch 'public/master'
gwhelanLD Jul 16, 2021
24a4fdc
ch103537 bump java-sdk-common to 1.2 to support inExperiment on eval …
robertjneal Jul 31, 2021
27f48f9
Merge remote-tracking branch 'public/master'
gwhelanLD Aug 6, 2021
868852b
Merge branch 'master' of github.com:launchdarkly/android-client-sdk
bwoskow-ld Aug 23, 2021
006a4eb
Merge remote-tracking branch 'public/master'
gwhelanLD Sep 3, 2021
675c2c6
Remove `allowBackup` manifest attribute that can conflict with the ap…
gwhelanLD Sep 3, 2021
a99c76a
Merge remote-tracking branch 'public/master'
gwhelanLD Sep 3, 2021
41374ee
Merge remote-tracking branch 'public/master'
gwhelanLD Oct 14, 2021
9947ae6
Update the version to 2.8.9
louis-launchdarkly Dec 15, 2021
21c9d69
Merge pull request #218 from launchdarkly/lchan/sc-134860/bump-gson
louis-launchdarkly Dec 16, 2021
76dbb79
Merge remote-tracking branch 'public/master'
louis-launchdarkly Dec 17, 2021
7880a23
Add explicit proguard directives for keeping BroadcastReceivers. (#219)
gwhelanLD Dec 30, 2021
8d8ac88
Bump Gradle, Android Gradle Plugin, and Dexcount Gradle
louis-launchdarkly Feb 10, 2022
5c8c21f
Use the latest 7.1.1 version
louis-launchdarkly Feb 10, 2022
3bbb98c
Using the version that still support Java 8 but pin the grgit core be…
louis-launchdarkly Feb 23, 2022
16a8f77
Merge pull request #221 from launchdarkly/lc/bump-gradle-git-publish
louis-launchdarkly Feb 24, 2022
52aabda
Merge branch 'master' of github.com:launchdarkly/android-client-sdk
louis-launchdarkly Feb 24, 2022
d3dd1fc
Remove Android Appcompat dependency (#222)
gwhelanLD Feb 25, 2022
78a6040
Bump dependencies and reorganize Gradle file somewhat. (#223)
gwhelanLD Feb 25, 2022
5edcbef
Add the null check to prevent multiple allocation of the DiagnosticEv…
louis-launchdarkly Mar 4, 2022
a4dccfc
Merge pull request #225 from launchdarkly/lc/sc-140256/fix-diagnostic…
louis-launchdarkly Mar 9, 2022
b1917e1
Merge remote-tracking branch 'public/master'
louis-launchdarkly Mar 23, 2022
20672ed
Merge remote-tracking branch 'public/master'
louis-launchdarkly Mar 23, 2022
ec416bf
Merge remote-tracking branch 'public/master'
aengelberg May 5, 2022
2834694
Merge remote-tracking branch 'public/master'
aengelberg May 5, 2022
c0601b5
Merge branch 'main' of github.com:launchdarkly/android-client-sdk
louis-launchdarkly May 6, 2022
94d29f8
Fix sonatype release plugin (#226)
aengelberg May 18, 2022
9ff67da
Add .ldrelease configuration (#227)
aengelberg May 26, 2022
94701ac
Add contract test service (#228)
aengelberg Jul 12, 2022
6beddd0
Fix test service failing on later API versions (#229)
aengelberg Jul 12, 2022
da8ac92
Refactor CI config into separate jobs with a matrix (#230)
aengelberg Jul 18, 2022
b339a98
Don't auto-retry emulator tests (#231)
aengelberg Jul 18, 2022
09ebb24
Add contract tests for API level 21 (#232)
aengelberg Jul 19, 2022
254ee8a
Remove unnecessary locking in LDClient (#233)
aengelberg Jul 29, 2022
d6dde2d
Merge remote-tracking branch 'public/main'
aengelberg Jul 29, 2022
6fa29fd
merge from public after release
Aug 1, 2022
84866a0
Merge remote-tracking branch 'public/main'
aengelberg Aug 1, 2022
e3b4083
Run contract tests on Android 31, 33 (#234)
aengelberg Aug 2, 2022
0705067
Merge remote-tracking branch 'public/main'
aengelberg Aug 16, 2022
be20356
merge from public after release
Aug 17, 2022
72c7cd6
Merge remote-tracking branch 'public/main'
aengelberg Aug 17, 2022
fae2bc5
Unsuppress streaming/requests and polling/requests (#236)
aengelberg Aug 19, 2022
e323da8
don't create a new executor just to trigger a flush
eli-darkly Aug 22, 2022
4f5aa80
remove short publishing timeout, use defaults of 60 retries & 10 seconds
eli-darkly Aug 22, 2022
a526c26
Merge pull request #241 from launchdarkly/eb/sc-165241/publish-timeout
eli-darkly Aug 22, 2022
79c94c3
Merge pull request #240 from launchdarkly/eb/sc-165702/executor-leak
eli-darkly Aug 22, 2022
b0f62b6
Serialize null values of `anonymous` as null (#237)
aengelberg Aug 22, 2022
ea16b7c
fix URL path concatenation to avoid double slashes
eli-darkly Aug 22, 2022
bd517ac
Merge branch 'main' into eb/sc-169965/url-path-concat
eli-darkly Aug 22, 2022
101b931
fix NPE in edge case where variation is null but value isn't
eli-darkly Aug 22, 2022
ffe6e1e
Merge pull request #242 from launchdarkly/eb/sc-169965/url-path-concat
eli-darkly Aug 22, 2022
1ea23fa
Merge branch 'main' into eb/sc-159880/null-variation
eli-darkly Aug 22, 2022
1a23386
Merge pull request #243 from launchdarkly/eb/sc-159880/null-variation
eli-darkly Aug 23, 2022
d57b50c
use SecureRandom instead of Random, just to make scanners happier
eli-darkly Aug 23, 2022
3f5f399
rm unused
eli-darkly Aug 23, 2022
7a04972
fix deletion versioning logic, implement tombstones (#244)
eli-darkly Aug 23, 2022
4d95021
disable contract tests for API 31/33
eli-darkly Aug 23, 2022
0671e4d
Merge branch 'eb/sc-160828/disable-contract-tests-31-33' into eb/sc-1…
eli-darkly Aug 23, 2022
24f08b1
Merge pull request #246 from launchdarkly/eb/sc-160828/disable-contra…
eli-darkly Aug 23, 2022
95eaeef
use okhttp-eventsource 1.11.3
eli-darkly Aug 23, 2022
551ab96
Merge pull request #245 from launchdarkly/eb/sc-164297/secure-random
eli-darkly Aug 23, 2022
5caabf4
ensure timed-out clients get closed in contract tests
eli-darkly Aug 23, 2022
1b2e4c1
clean up instances map on close (#247)
eli-darkly Aug 23, 2022
f93743b
rm unnecessary LDClientControl
eli-darkly Aug 23, 2022
e33318a
Merge branch 'main' into eb/sc-165480/contract-tests-close-client
eli-darkly Aug 23, 2022
da45fe6
Merge pull request #248 from launchdarkly/eb/sc-165480/contract-tests…
eli-darkly Aug 23, 2022
a7f0fd8
merge from public after release
Aug 23, 2022
70cd057
use com.launchdarkly.logging with Timber adapter (#235)
eli-darkly Aug 23, 2022
288cef6
merge from public after release
Aug 23, 2022
a17eacd
Merge branch 'main' into lc/sc-135900/bump-gradle
eli-darkly Aug 23, 2022
4ed1d01
rm unused plugin
eli-darkly Aug 23, 2022
4732a22
Merge pull request #220 from launchdarkly/lc/sc-135900/bump-gradle
louis-launchdarkly Aug 25, 2022
24aedab
clean up leftover polling alarms
eli-darkly Sep 27, 2022
6f441bb
Merge pull request #265 from launchdarkly/eb/sc-169505/cleanup-alarm
eli-darkly Sep 28, 2022
dfb6be5
merge from public after release
Sep 28, 2022
8cd49ec
don't use connection pool/keep-alive for polling requests
eli-darkly Oct 27, 2022
5a754bb
Merge pull request #271 from launchdarkly/eb/sc-173149/keep-alive
eli-darkly Oct 27, 2022
ac3e047
merge from public after release
Oct 27, 2022
1f9710d
add sub-configuration builder for events
eli-darkly Nov 9, 2022
110ce35
diagnosticRecordingInterval should also be part of the new builder
eli-darkly Nov 9, 2022
0134de4
misc fixes
eli-darkly Nov 9, 2022
7326eea
remove deprecated usages & unused imports
eli-darkly Nov 9, 2022
ef80ba6
misc fixes
eli-darkly Nov 9, 2022
d978fcc
revert unnecessary change
eli-darkly Nov 9, 2022
cab2b24
doc comments
eli-darkly Nov 9, 2022
4d58b3e
add configuration builders for polling/streaming
eli-darkly Nov 9, 2022
f77bbc7
fix polling mode initialization
eli-darkly Nov 9, 2022
f8c57b1
fix diagnostic event properties
eli-darkly Nov 9, 2022
4d5c806
fix logic for diagnostic recording interval
eli-darkly Nov 9, 2022
5f3a475
Merge branch 'eb/sc-176169/events-config-builder' into eb/sc-176169/d…
eli-darkly Nov 9, 2022
1d10a18
fix tests
eli-darkly Nov 9, 2022
29c37a1
fix defaulting logic
eli-darkly Nov 9, 2022
cf3304f
fix test
eli-darkly Nov 10, 2022
9f6e4a8
add configuration builder for HTTP
eli-darkly Nov 10, 2022
3d2829e
improve tests
eli-darkly Nov 10, 2022
6b13c4f
Merge branch 'eb/sc-176169/events-config-builder' into eb/sc-176169/d…
eli-darkly Nov 10, 2022
c7faa1e
test cleanup
eli-darkly Nov 10, 2022
dd766d8
Merge branch 'eb/sc-176169/data-source-config' into eb/sc-176169/http…
eli-darkly Nov 10, 2022
6c5be69
fix test
eli-darkly Nov 10, 2022
c412326
add configuration builder for service endpoints
eli-darkly Nov 11, 2022
571a6c4
misc fixes
eli-darkly Nov 11, 2022
24894e4
disable diagnostic events if analytics events are disabled
eli-darkly Nov 11, 2022
b58798a
Merge branch 'eb/sc-176169/events-config-builder' into eb/sc-176169/d…
eli-darkly Nov 11, 2022
8ccf17a
deprecations
eli-darkly Nov 11, 2022
6d869f6
Merge branch 'eb/sc-176169/data-source-config' into eb/sc-176169/http…
eli-darkly Nov 11, 2022
5bbc013
Merge branch 'eb/sc-176169/http-config' into eb/sc-176169/service-end…
eli-darkly Nov 11, 2022
da2b70c
don't keep summary event counters in SharedPreferences
eli-darkly Nov 15, 2022
b937dc2
don't create a summary event if there's no data
eli-darkly Nov 15, 2022
7a45404
rm duplicated lines
eli-darkly Nov 17, 2022
c2e0729
use regular in-memory storage for summary events (customer-reported p…
eli-darkly Nov 17, 2022
09d4328
fix doc comment
eli-darkly Nov 17, 2022
d53534d
merge from public after release
Nov 17, 2022
891b95a
Merge branch 'eb/sc-176628/in-memory-summary' into eb/sc-176169/event…
eli-darkly Nov 17, 2022
dd2ef74
Merge branch 'eb/sc-176169/events-config-builder' into eb/sc-176169/d…
eli-darkly Nov 17, 2022
073d6c3
Merge branch 'eb/sc-176169/data-source-config' into eb/sc-176169/http…
eli-darkly Nov 17, 2022
87b5b0e
Merge branch 'eb/sc-176169/http-config' into eb/sc-176169/service-end…
eli-darkly Nov 17, 2022
54db35a
Merge pull request #272 from launchdarkly/eb/sc-176169/events-config-…
eli-darkly Nov 17, 2022
7ce4bcf
Merge pull request #273 from launchdarkly/eb/sc-176169/data-source-co…
eli-darkly Nov 17, 2022
429878d
fix @since
eli-darkly Nov 22, 2022
fb0883d
Merge pull request #276 from launchdarkly/eb/sc-176169/http-config
eli-darkly Nov 22, 2022
491c82a
Merge pull request #278 from launchdarkly/eb/sc-176169/service-endpoints
eli-darkly Nov 22, 2022
e1dece8
merge from public after release
Dec 2, 2022
dc14802
do an initial poll if SDK starts in the background (3.x) (#286)
eli-darkly Dec 21, 2022
7ff8032
Merge branch '3.x' of github.com:launchdarkly/android-client-sdk into…
eli-darkly Dec 21, 2022
14d9d73
merge from public after release
Dec 21, 2022
ecdc5f3
add streamEvenInBackground option (3.x) (#287)
eli-darkly Dec 23, 2022
4985a30
Merge branch '3.x' of github.com:launchdarkly/android-client-sdk into…
eli-darkly Dec 23, 2022
10be9dd
merge from public after release
Dec 23, 2022
ced39cf
Merge branch '3.x' of github.com:launchdarkly/android-client-sdk-priv…
eli-darkly Dec 23, 2022
82851dc
re-fix previous fix for connection keep-alive
eli-darkly Jan 7, 2023
e442577
Merge pull request #288 from launchdarkly/eb/sc-173149/no-keepalive-2
eli-darkly Jan 7, 2023
2358429
merge from public after release
Jan 7, 2023
c9b168e
add ApplicationInfo a.k.a. tags (3.x) (#289)
eli-darkly Jan 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.launchdarkly.sdk.android.LDClient;
import com.launchdarkly.sdk.android.LDConfig;

import com.launchdarkly.sdk.android.integrations.ApplicationInfoBuilder;
import com.launchdarkly.sdk.android.integrations.EventProcessorBuilder;
import com.launchdarkly.sdk.android.integrations.PollingDataSourceBuilder;
import com.launchdarkly.sdk.android.integrations.ServiceEndpointsBuilder;
Expand Down Expand Up @@ -247,6 +248,17 @@ private LDConfig buildSdkConfig(SdkConfigParams params, LDLogAdapter logAdapter,
Components.httpConfiguration().useReport(params.clientSide.useReport)
);

if (params.tags != null) {
ApplicationInfoBuilder ab = Components.applicationInfo();
if (params.tags.applicationId != null) {
ab.applicationId(params.tags.applicationId);
}
if (params.tags.applicationVersion != null) {
ab.applicationVersion(params.tags.applicationVersion);
}
builder.applicationInfo(ab);
}

if (params.serviceEndpoints != null) {
if (params.serviceEndpoints.streaming != null) {
endpoints.streaming(params.serviceEndpoints.streaming);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class TestService extends NanoHTTPD {
"service-endpoints",
"singleton",
"strongly-typed",
"tags"
};
private static final String MIME_JSON = "application/json";
static final Gson gson = new GsonBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,20 @@ static ClientContextImpl fromConfig(
SummaryEventStore summaryEventStore,
LDLogger logger
) {
ClientContext minimalContext = new ClientContext(null, mobileKey, logger, config,
ClientContext minimalContext = new ClientContext(null, config.applicationInfo, logger, config,
environmentName, config.isEvaluationReasons(), null, config.isOffline(),
config.serviceEndpoints);
mobileKey, config.serviceEndpoints);
HttpConfiguration httpConfig = config.http.build(minimalContext);
ClientContext baseClientContext = new ClientContext(
application,
mobileKey,
config.applicationInfo,
logger,
config,
environmentName,
config.isEvaluationReasons(),
httpConfig,
config.isOffline(),
mobileKey,
config.serviceEndpoints
);
return new ClientContextImpl(baseClientContext, diagnosticStore, sharedEventClient, summaryEventStore);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static com.launchdarkly.sdk.android.ComponentsImpl.NULL_EVENT_PROCESSOR_FACTORY;

import com.launchdarkly.sdk.android.integrations.ApplicationInfoBuilder;
import com.launchdarkly.sdk.android.integrations.EventProcessorBuilder;
import com.launchdarkly.sdk.android.integrations.HttpConfigurationBuilder;
import com.launchdarkly.sdk.android.integrations.PollingDataSourceBuilder;
Expand All @@ -25,6 +26,28 @@
public abstract class Components {
private Components() {}

/**
* Returns a configuration builder for the SDK's application metadata.
* <p>
* Passing this to {@link LDConfig.Builder#applicationInfo(com.launchdarkly.sdk.android.integrations.ApplicationInfoBuilder)},
* after setting any desired properties on the builder, applies this configuration to the SDK.
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* .applicationInfo(
* Components.applicationInfo()
* .applicationId("authentication-service")
* .applicationVersion("1.0.0")
* )
* .build();
* </code></pre>
*
* @return a builder object
* @see LDConfig.Builder#applicationInfo(com.launchdarkly.sdk.android.integrations.ApplicationInfoBuilder)
*/
public static ApplicationInfoBuilder applicationInfo() {
return new ApplicationInfoBuilder();
}

/**
* Returns a configuration builder for the SDK's networking configuration.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ public HttpConfiguration build(ClientContext clientContext) {
Map<String, String> headers = new HashMap<>();
headers.put("Authorization", LDUtil.AUTH_SCHEME + clientContext.getMobileKey());
headers.put("User-Agent", LDUtil.USER_AGENT_HEADER_VALUE);
if (clientContext.getApplicationInfo() != null) {
String tagHeader = LDUtil.applicationTagHeader(clientContext.getApplicationInfo(),
clientContext.getBaseLogger());
if (!tagHeader.isEmpty()) {
headers.put("X-LaunchDarkly-Tags", tagHeader);
}
}
if (wrapperName != null) {
String wrapperId = wrapperVersion == null ? wrapperName : (wrapperName + "/" + wrapperVersion);
headers.put("X-LaunchDarkly-Wrapper", wrapperId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
import com.launchdarkly.logging.Logs;
import com.launchdarkly.sdk.LDUser;
import com.launchdarkly.sdk.UserAttribute;
import com.launchdarkly.sdk.android.integrations.ApplicationInfoBuilder;
import com.launchdarkly.sdk.android.integrations.EventProcessorBuilder;
import com.launchdarkly.sdk.android.integrations.HttpConfigurationBuilder;
import com.launchdarkly.sdk.android.integrations.PollingDataSourceBuilder;
import com.launchdarkly.sdk.android.integrations.ServiceEndpointsBuilder;
import com.launchdarkly.sdk.android.integrations.StreamingDataSourceBuilder;
import com.launchdarkly.sdk.android.subsystems.ApplicationInfo;
import com.launchdarkly.sdk.android.subsystems.ComponentConfigurer;
import com.launchdarkly.sdk.android.subsystems.DataSource;
import com.launchdarkly.sdk.android.subsystems.EventProcessor;
Expand Down Expand Up @@ -71,6 +73,7 @@ public class LDConfig {
private final Uri eventsUri;
private final Uri streamUri;

final ApplicationInfo applicationInfo;
final ComponentConfigurer<DataSource> dataSource;
final ComponentConfigurer<EventProcessor> events;
final ComponentConfigurer<HttpConfiguration> http;
Expand Down Expand Up @@ -107,6 +110,7 @@ public class LDConfig {
Uri pollUri,
Uri eventsUri,
Uri streamUri,
ApplicationInfo applicationInfo,
ComponentConfigurer<DataSource> dataSource,
ComponentConfigurer<EventProcessor> events,
ComponentConfigurer<HttpConfiguration> http,
Expand Down Expand Up @@ -138,6 +142,7 @@ public class LDConfig {
this.pollUri = pollUri;
this.eventsUri = eventsUri;
this.streamUri = streamUri;
this.applicationInfo = applicationInfo;
this.dataSource = dataSource;
this.events = events;
this.http = http;
Expand Down Expand Up @@ -469,6 +474,7 @@ public static class Builder {
private Uri eventsUri = DEFAULT_EVENTS_URI;
private Uri streamUri = DEFAULT_STREAM_URI;

private ApplicationInfoBuilder applicationInfoBuilder = null;
private ComponentConfigurer<DataSource> dataSource = null;
private ComponentConfigurer<EventProcessor> events = null;
private ComponentConfigurer<HttpConfiguration> http = null;
Expand Down Expand Up @@ -652,6 +658,22 @@ public LDConfig.Builder streamUri(Uri streamUri) {
return this;
}

/**
* Sets the SDK's application metadata, which may be used in LaunchDarkly analytics or other product features,
* but does not affect feature flag evaluations.
* <p>
* This object is normally a configuration builder obtained from {@link Components#applicationInfo()},
* which has methods for setting individual metadata properties.
*
* @param applicationInfoBuilder a configuration builder object returned by {@link Components#applicationInfo()}
* @return the builder
* @since 3.3.0
*/
public Builder applicationInfo(ApplicationInfoBuilder applicationInfoBuilder) {
this.applicationInfoBuilder = applicationInfoBuilder;
return this;
}

/**
* Sets the configuration of the component that receives feature flag data from LaunchDarkly.
* <p>
Expand Down Expand Up @@ -1274,11 +1296,16 @@ public LDConfig build() {
Components.serviceEndpoints().polling(pollUri).streaming(streamUri).events(eventsUri).build() :
this.serviceEndpointsBuilder.build();

ApplicationInfo applicationInfo = this.applicationInfoBuilder == null ?
Components.applicationInfo().createApplicationInfo() :
applicationInfoBuilder.createApplicationInfo();

return new LDConfig(
mobileKeys,
pollUri,
eventsUri,
streamUri,
applicationInfo,
dataSourceConfig,
eventsConfig,
httpConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,60 @@
import com.launchdarkly.sdk.LDUser;
import com.launchdarkly.sdk.LDValue;
import com.launchdarkly.sdk.UserAttribute;
import com.launchdarkly.sdk.android.subsystems.ApplicationInfo;
import com.launchdarkly.sdk.android.subsystems.HttpConfiguration;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;

import okhttp3.Headers;

class LDUtil {
static final String AUTH_SCHEME = "api_key ";
static final String USER_AGENT_HEADER_VALUE = "AndroidClient/" + BuildConfig.VERSION_NAME;

// Tag values must not be empty, and only contain letters, numbers, `.`, `_`, or `-`.
private static Pattern TAG_VALUE_REGEX = Pattern.compile("^[-a-zA-Z0-9._]+$");

/**
* Builds the "X-LaunchDarkly-Tags" HTTP header out of the configured application info.
*
* @param applicationInfo the application metadata
* @return a space-separated string of tags, e.g. "application-id/authentication-service application-version/1.0.0"
*/
static String applicationTagHeader(ApplicationInfo applicationInfo, LDLogger logger) {
String[][] tags = {
{"applicationId", "application-id", applicationInfo.getApplicationId()},
{"applicationVersion", "application-version", applicationInfo.getApplicationVersion()},
};
List<String> parts = new ArrayList<>();
for (String[] row : tags) {
String javaKey = row[0];
String tagKey = row[1];
String tagVal = row[2];
if (tagVal == null) {
continue;
}
if (!TAG_VALUE_REGEX.matcher(tagVal).matches()) {
logger.warn("Value of ApplicationInfo.{} contained invalid characters and was discarded", javaKey);
continue;
}
if (tagVal.length() > 64) {
logger.warn("Value of ApplicationInfo.{} was longer than 64 characters and was discarded", javaKey);
continue;
}
parts.add(tagKey + "/" + tagVal);
}
return String.join(" ", parts);
}

static Headers makeRequestHeaders(
@NonNull HttpConfiguration httpConfig,
Map<String, String> additionalHeaders
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package com.launchdarkly.sdk.android.integrations;

import com.launchdarkly.sdk.android.Components;
import com.launchdarkly.sdk.android.subsystems.ApplicationInfo;

/**
* Contains methods for configuring the SDK's application metadata.
* <p>
* Application metadata may be used in LaunchDarkly analytics or other product features, but does not affect feature flag evaluations.
* <p>
* If you want to set non-default values for any of these fields, create a builder with
* {@link Components#applicationInfo()}, change its properties with the methods of this class,
* and pass it to {@link com.launchdarkly.sdk.android.LDConfig.Builder#applicationInfo(ApplicationInfoBuilder)}:
* <pre><code>
* LDConfig config = new LDConfig.Builder()
* .applicationInfo(
* Components.applicationInfo()
* .applicationId("authentication-service")
* .applicationVersion("1.0.0")
* )
* .build();
* </code></pre>
* <p>
*
* @since 3.3.0
*/
public final class ApplicationInfoBuilder {
private String applicationId;
private String applicationVersion;

/**
* Create an empty ApplicationInfoBuilder.
*
* @see Components#applicationInfo()
*/
public ApplicationInfoBuilder() {}

/**
* Sets a unique identifier representing the application where the LaunchDarkly SDK is running.
* <p>
* This can be specified as any string value as long as it only uses the following characters: ASCII
* letters, ASCII digits, period, hyphen, underscore. A string containing any other characters will be
* ignored.
*
* @param applicationId the application identifier
* @return the builder
*/
public ApplicationInfoBuilder applicationId(String applicationId) {
this.applicationId = applicationId;
return this;
}

/**
* Sets a unique identifier representing the version of the application where the LaunchDarkly SDK
* is running.
* <p>
* This can be specified as any string value as long as it only uses the following characters: ASCII
* letters, ASCII digits, period, hyphen, underscore. A string containing any other characters will be
* ignored.
*
* @param applicationVersion the application version
* @return the builder
*/
public ApplicationInfoBuilder applicationVersion(String applicationVersion) {
this.applicationVersion = applicationVersion;
return this;
}

/**
* Called internally by the SDK to create the configuration object.
*
* @return the configuration object
*/
public ApplicationInfo createApplicationInfo() {
return new ApplicationInfo(applicationId, applicationVersion);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.launchdarkly.sdk.android.subsystems;

import com.launchdarkly.sdk.android.integrations.ApplicationInfoBuilder;

/**
* Encapsulates the SDK's application metadata.
* <p>
* See {@link ApplicationInfoBuilder} for more details on these properties.
*
* @since 3.3.0
*/
public final class ApplicationInfo {
private String applicationId;
private String applicationVersion;

/**
* Used internally by the SDK to store application metadata.
*
* @param applicationId the application ID
* @param applicationVersion the application version
* @see ApplicationInfoBuilder
*/
public ApplicationInfo(String applicationId, String applicationVersion) {
this.applicationId = applicationId;
this.applicationVersion = applicationVersion;
}

/**
* A unique identifier representing the application where the LaunchDarkly SDK is running.
*
* @return the application identifier, or null
*/
public String getApplicationId() {
return applicationId;
}

/**
* A unique identifier representing the version of the application where the
* LaunchDarkly SDK is running.
*
* @return the application version, or null
*/
public String getApplicationVersion() {
return applicationVersion;
}
}
Loading