[Android] Expose IDataViewer as public Java API - #1534
Open
KartikDhawaniya wants to merge 1 commit into
Open
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
|
@microsoft-github-policy-service agree company="Microsoft" |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The public interface change breaks source compatibility, and callback lifecycle documentation and unregistration coverage need correction.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds a public Android/JNI bridge for registering product-owned IDataViewer implementations.
Changes:
- Adds the Java callback API and LogManager registration methods.
- Implements JNI proxy lifecycle, callback forwarding, and cleanup.
- Adds shrinker rules and instrumentation coverage.
File summaries
| File | Description |
|---|---|
lib/jni/LogManager_jni.cpp |
Manages viewer registration and cleanup. |
lib/jni/JavaDataViewerProxy.hpp |
Declares the JNI viewer proxy. |
lib/jni/JavaDataViewerProxy.cpp |
Implements Java callback forwarding. |
lib/CMakeLists.txt |
Builds the new proxy source. |
lib/android_build/maesdk/src/main/java/com/microsoft/applications/events/LogManagerProvider.java |
Implements Java registration APIs. |
lib/android_build/maesdk/src/main/java/com/microsoft/applications/events/ILogManager.java |
Exposes registration publicly. |
lib/android_build/maesdk/src/main/java/com/microsoft/applications/events/IDataViewer.java |
Defines the callback contract. |
lib/android_build/maesdk/consumer-rules.pro |
Preserves reverse-JNI callback methods. |
lib/android_build/app/src/androidTest/java/com/microsoft/applications/events/maesdktest/LogManagerDDVUnitTest.java |
Tests registration and dispatch behavior. |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| * @return {@code true} when the viewer was registered, {@code false} for invalid input or a | ||
| * duplicate viewer name | ||
| */ | ||
| public boolean registerDataViewer(IDataViewer dataViewer); |
Contributor
There was a problem hiding this comment.
KartikDhawaniya This is the most important comment from CoPilot to address
Comment on lines
+333
to
+334
| assertThat(manager.unregisterDataViewer("receiving-viewer"), is(true)); | ||
| assertThat(manager.unregisterDataViewer("receiving-viewer"), is(false)); |
Comment on lines
+13
to
+14
| * Callbacks can occur on an SDK worker thread and should return promptly. Implementations must not | ||
| * register or unregister viewers from within a callback. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expose the native 1DS
IDataViewerextension point through the Android Java/JNI API so Android consumers can register a product-owned viewer without changing the bundledDefaultDataViewerimplementation.This enables consumers such as Teams Android to keep broad Network Security Configuration cleartext traffic disabled while owning any product-specific diagnostic transport outside the SDK.
Changes
IDataViewercallback contract.registerDataViewerandunregisterDataViewertoILogManagerandLogManagerProvider.LogManagerImpl.IDataViewerproxy that:byte[];Scope
This is an additive Android API bridge over the existing native extension point. It does not change:
DefaultDataViewerAPIs; orValidation
:maesdk:assembleDebug:app:compileDebugAndroidTestJavaWithJavacarm64-v8a,armeabi-v7a,x86, andx86_64The instrumentation test was compiled but not executed because no Android device was connected.