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

Implement Mobile Device Manager feature with 3 keys. #8698

Merged
merged 4 commits into from
Dec 11, 2023
Merged

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Nov 30, 2023

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Add support for MDM with the following keys:

  • default homeserver URL - im.vector.app.serverConfigDefaultHomeserverUrlString
  • push gateway URL - im.vector.app.serverConfigSygnalAPIUrlString
  • permalink base URL - im.vector.app.clientPermalinkBaseUrl

iOS PR: element-hq/element-ios#7667

Motivation and context

Support MDM.

Internal issue: https://github.com/vector-im/element-internal/issues/527

Screenshots / GIFs

Tests

Cannot test using a real MDM configuration, but can be tested by hacking the method getData to return a custom string.
I have tested by returning a value for MdmData.DefaultHomeserverUrl different from matrix.org and the application was correctly defaulting to the provided homeserver.

Also currently when the MDM configuration change, this is a no-op on the application. We may consider logging out the user.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

@bmarty bmarty requested review from ganfra and giomfo December 1, 2023 08:29
Copy link
Member

@ganfra ganfra left a comment

Choose a reason for hiding this comment

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

One change on the DI otherwise LGTM

@@ -168,6 +173,11 @@ import javax.inject.Singleton
return Matrix(context, configuration)
}

@Provides
Copy link
Member

@ganfra ganfra Dec 4, 2023

Choose a reason for hiding this comment

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

You should use @Singleton otherwise listeners won't be kept.
Also use @Binds instead of @Provides

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 6452b5c, hence I think it was fine since the listener was added and removed by the same entity (the Activity).
OK for you?

Copy link

sonarcloud bot commented Dec 6, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 1 Code Smell

45.9% 45.9% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.21) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

Copy link
Member

@giomfo giomfo left a comment

Choose a reason for hiding this comment

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

just one question

Copy link
Member

@giomfo giomfo left a comment

Choose a reason for hiding this comment

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

SGTM

@bmarty bmarty merged commit 1c1c89f into develop Dec 11, 2023
13 of 14 checks passed
@bmarty bmarty deleted the feature/bma/mdm branch December 11, 2023 16:03
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.

3 participants