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

Engine bridge interface + Android implementation #30

Merged
merged 4 commits into from
Aug 5, 2024
Merged

Conversation

sdsantos
Copy link
Contributor

@sdsantos sdsantos commented Jul 31, 2024

Closes #17
Closes #19

The OonimkallBridge.kt file is the most important part, the Bridge interface each platform has to implement. I believe I covered all our use cases, but please check.

I tried hiding the Session Context inside the bridge implementations. I feel it isn't too much on an hassle for the platforms. Not sure what timeout to use though.

@aanorbel Hope you can help with the iOS implementation :) (#20)

@sdsantos sdsantos requested a review from aanorbel July 31, 2024 17:12
@aanorbel
Copy link
Member

Will look into that.

Copy link
Member

@aanorbel aanorbel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐳

options =
TaskSettings.Options(
noCollector = true,
softwareName = Config.BASE_SOFTWARE_NAME,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This software_name is set to ooniprobe-android-unattended when the tests are run from the background and ooniprobe-android.

See Raw Measurement Data in https://explorer.ooni.org/m/20240731235959.972250_IE_webconnectivity_50b43329c29ed566

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, you can disregard the DashboardViewModel.kt code. I just kept the "Run Test" working to see if everything was fine. But we're never collecting/uploading, we still need to do the Engine SDK to properly set all configs.

@@ -73,7 +77,19 @@ class DashboardViewModel(
TaskSettings(
name = "web_connectivity",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to start defining various test "classes" as some tests have different keys.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same reply #30 (comment)

Comment on lines +13 to +14
Wifi("wifi"),
Mobile("mobile"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to start thinking of devices connected to the internet through TRANSPORT_BLUETOOTH, TRANSPORT_ETHERNET, TRANSPORT_USB especially on android that supports these options in the Mobile Hotspot and Tethering option.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. Didn't think about those, I was just following the current implementation on the Android app. Maybe that will be future work, after we reach feature parity?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that works for me.


object TaskLogLevelSerializer : KSerializer<TaskLogLevel> {
override val descriptor =
PrimitiveSerialDescriptor("TaskLogLevel", PrimitiveKind.STRING)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to use class name here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The official examples use the class name of the type we're serializing: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md#primitive-serializer

@sdsantos sdsantos merged commit 092afc7 into main Aug 5, 2024
7 checks passed
@sdsantos sdsantos deleted the engine-bridge branch August 5, 2024 11:17
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

Successfully merging this pull request may close these issues.

Multi-platform: Implement Android Engine Bridge Multi-platform: Create engine Specification
2 participants