Skip to content

feat: implement Android user context provider and managed config parser for MDM support [WPB-23327]#4572

Open
MohamadJaara wants to merge 1 commit intodevelopfrom
mo/multi-app-mdm-config
Open

feat: implement Android user context provider and managed config parser for MDM support [WPB-23327]#4572
MohamadJaara wants to merge 1 commit intodevelopfrom
mo/multi-app-mdm-config

Conversation

@MohamadJaara
Copy link
Member

@MohamadJaara MohamadJaara commented Feb 5, 2026

https://wearezeta.atlassian.net/browse/WPB-23327

Glad you asked—this is the kind of detail that keeps PRs smooth. Here’s the template filled out for the context‑aware MDM config feature, with a suggested PR title and honest testing notes.


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

Enable enterprise MDM configurations to be resolved per Android user context so multiple Wire instances on the same device (primary user vs work profile/secure container) can use different server endpoints and SSO codes.

Causes (Optional)

Current managed configuration parsing only supports a single unified config and does not account for Android user context, so both app instances read the same restrictions and cannot be independently configured.

Solutions

Introduce an Android user context provider and a managed configuration parser that supports both unified and context‑mapped formats. Resolve configs by string‑matching the current Android user ID key with a default fallback, and apply server/SSO configs per context with validation and safe fallbacks.

Dependencies (Optional)

Needs releases with:

  • GitHub link to other pull request

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Run unit tests for EMM parsing and manager behavior, for example:
./gradlew test
Verify tests in ManagedConfigParserTest, ManagedConfigurationsManagerTest, and AndroidUserContextProviderTest pass.

Notes (Optional)

Context matching is based on simple string keys of the Android user ID (Process.myUid() / 100000). If no matching key exists, default is used; otherwise server config falls back to app defaults and SSO is cleared.

Attachments (Optional)

N/A


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

Suggested PR Title (meets requirements):
feat(emm): If merged, this PR will support context-aware MDM config resolution #SQPIT-XXXX

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 5, 2026

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 80.70175% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.57%. Comparing base (c752396) to head (902ffe9).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
...m/wire/android/emm/ManagedConfigurationsManager.kt 64.70% 4 Missing and 2 partials ⚠️
...com/wire/android/emm/AndroidUserContextProvider.kt 0.00% 4 Missing ⚠️
...kotlin/com/wire/android/emm/ManagedConfigParser.kt 97.22% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4572      +/-   ##
===========================================
+ Coverage    48.50%   48.57%   +0.07%     
===========================================
  Files          575      577       +2     
  Lines        19810    19857      +47     
  Branches      3312     3321       +9     
===========================================
+ Hits          9608     9646      +38     
- Misses        9187     9195       +8     
- Partials      1015     1016       +1     
Files with missing lines Coverage Δ
...kotlin/com/wire/android/emm/ManagedConfigParser.kt 97.22% <97.22%> (ø)
...com/wire/android/emm/AndroidUserContextProvider.kt 0.00% <0.00%> (ø)
...m/wire/android/emm/ManagedConfigurationsManager.kt 84.33% <64.70%> (-3.83%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c752396...902ffe9. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant