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

SimpleNetworkDetector uses deprecated APIs #49

Open
breedx-splk opened this issue Aug 25, 2023 · 5 comments
Open

SimpleNetworkDetector uses deprecated APIs #49

breedx-splk opened this issue Aug 25, 2023 · 5 comments
Assignees

Comments

@breedx-splk
Copy link
Contributor

There is a build warning about the SimpleNetworkDetector using deprecated APIs. I believe that this is specifically related to the use of NetworkInfo and some of the methods (see the comments in SimpleNetworkDetector).

The Elastic android instrumentation seems to agree with a long-lived stackoverflow post about how to mitigate this.

Although things are probably still working, it would be nice to migrate to a more sophisticated/robust solution going forward.

@breedx-splk
Copy link
Contributor Author

Then again, because the SimpleNetworkDetector is really only wired up in older SDKs, suppressing the warning might be appropriate.

@LikeTheSalad
Copy link
Contributor

There was an important API addition in the way Android provides a "default" network connectivity info on API 24 that makes this a lot easier, which is the one we use in the Elastic agent. I think it's worth waiting on the outcome of open-telemetry/opentelemetry-java#5936 before adding any further changes to SimpleNetworkDetector or to the overall network detection mechanism.

@LikeTheSalad
Copy link
Contributor

As a side note, it seems like the overall network detection process is started here, although I can't find where this function is called, so I'm wondering if this is currently dead code @breedx-splk?

@breedx-splk
Copy link
Contributor Author

As a side note, it seems like the overall network detection process is started here, although I can't find where this function is called, so I'm wondering if this is currently dead code @breedx-splk?

It's been a public method on a public class, so users can use it how they please. In the original Splunk code, it was called by the RumInitializer. Now with #121, it's called based on the config value, which defaults to true.

@LikeTheSalad
Copy link
Contributor

Ah, got it! I missed it in your PR. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants