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

[Device Manager] Extend user agent to include device information (PSG-755) #7209

Merged
merged 8 commits into from
Sep 29, 2022

Conversation

onurays
Copy link
Contributor

@onurays onurays commented Sep 22, 2022

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

User agent string improved by adding device information like:
Element dbg/1.5.0-dev (Xiaomi Mi 9T; Android 11; RKQ1.200826.002 test-keys; Flavour GooglePlay; MatrixAndroidSdk2 1.5.0)

Motivation and context

Screenshots / GIFs

Tests

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

@onurays onurays requested review from a team and fedrunov and removed request for a team September 22, 2022 12:26
@onurays onurays requested review from a team and bmarty and removed request for fedrunov and a team September 22, 2022 12:44
@onurays onurays marked this pull request as draft September 22, 2022 14:35
@onurays onurays marked this pull request as ready for review September 23, 2022 12:56
Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Only small remarks.
(Not for this PR, but we should change the way the app configures the user agent the SDK will use.)

"; Flavour " + flavorDescription +
"; MatrixAndroidSdk2 " + BuildConfig.SDK_VERSION + ")"
}
userAgent = computeUserAgentUseCase.execute(context, matrixConfiguration.applicationFlavor)
Copy link
Member

Choose a reason for hiding this comment

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

The context should be injected in ComputeUserAgentUseCase constructor instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, done.

@@ -0,0 +1 @@
[Device Manager] Extend user agent to include device information
Copy link
Member

Choose a reason for hiding this comment

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

Since the change is SDK side only, I would use .sdk extension.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Timber.e(e, "## initUserAgent() : failed")
}

val systemUserAgent = System.getProperty("http.agent")
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the removal of this part.

@sonarcloud
Copy link

sonarcloud bot commented Sep 29, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

95.6% 95.6% Coverage
0.0% 0.0% Duplication

@onurays onurays merged commit 1238f31 into develop Sep 29, 2022
@onurays onurays deleted the feature/ons/extend_user_agent branch September 29, 2022 10:11
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.

2 participants