Add nativeSetIntTicketToken JNI implementation in android_build
nativeSetIntTicketToken in LogManagerProvider.java is incomplete in the last PR: #1131
This PR aims:
- Implementation of
nativeSetIntTicketTokenin JNI, which turns out to be thesetTicketTokeninILogManager.java - Thread-safe in AuthTokensController.cpp to avoid race condition, we found some crashes because of race condition when using this sdk in Android system:
Scudo ERROR: race on chunk header
Why adding locks in AuthTokensController.cpp?
We get the token after the app log in one account (MSA, AAD, etc), and our application is a multi-account application. So currently our solution is we cache the token once we get from the server, then every time client calls the logEvent method, it will set the ticket token internally. We don't have the dependencies on logger instanceswhen we in the process of getting token.
We can't guarantee all the logEvent method will be called only in main thread only, so this introduces the multi-threading issues.
@lalitb Would you like to review this PR? We want to leverage this API to support our telemetry, thanks!
The CI failures are not related to this PR.