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

fix: Use DisplayMetrics instead of WindowManager for StrictMode Error #481

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

Mansi-mParticle
Copy link
Contributor

Instructions

  1. PR target branch should be against development
  2. PR title name should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-title-check.yml
  3. PR branch prefix should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-branch-check-name.yml

Summary

-Resolved StrictMode error by replacing direct usage of application context's WindowManager with DisplayMetrics.

Testing Plan

  • Was this tested locally? If not, explain why.
  • Tested locally

Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)

Copy link
Member

@samdozor samdozor left a comment

Choose a reason for hiding this comment

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

the PR title and the commit both contain a misspelling: should be "StrictMode"

they also don't describe the change. please think of a PR title that informs the user of what you changed and why.

also - please add a unit test. your default should always be to add a unit test. I think you could easily refactor the getOrientation method to either take a displaymetrics object or just take height/width, and then it's be very easy to add a test (or multiple) for it.

@Mansi-mParticle Mansi-mParticle changed the title fix: Strickmode Error fix: Strictmode Error May 1, 2024
@Mansi-mParticle Mansi-mParticle changed the title fix: Strictmode Error fix: Use DisplayMetrics instead of WindowManager for StrictMode Error May 1, 2024
@Mansi-mParticle Mansi-mParticle force-pushed the fix/SQDSDKS-6262 branch 2 times, most recently from d6b1dbd to 74978f0 Compare May 3, 2024 14:32
@rmi22186 rmi22186 force-pushed the development branch 4 times, most recently from fca8a44 to b67c108 Compare May 29, 2024 19:20
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