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

chore: enable penalty death on strict mode #2251

Merged
merged 4 commits into from
Sep 21, 2023

Conversation

ohassine
Copy link
Member

@ohassine ohassine commented Sep 20, 2023


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

This PR will enable penaltyDeath of StrictMode on ThreadPolicy, which means the app will crash if we run operations on Main thread instead of worker thread.

This is only on DEBUG build

Needs #2075 to be merged


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.

@ohassine ohassine requested review from a team, typfel, gongracr, yamilmedina, trOnk12 and saleniuk and removed request for a team September 20, 2023 12:14
Copy link
Contributor

@alexandreferris alexandreferris left a comment

Choose a reason for hiding this comment

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

Not really sure the BulletHoleImagePreview.kt changes should be in this PR

@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Merging #2251 (b866f95) into develop (13d5576) will not change coverage.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             develop    #2251   +/-   ##
==========================================
  Coverage      40.38%   40.38%           
  Complexity      1007     1007           
==========================================
  Files            318      318           
  Lines          11617    11617           
  Branches        1539     1539           
==========================================
  Hits            4691     4691           
  Misses          6487     6487           
  Partials         439      439           
Files Changed Coverage Δ
...rc/main/kotlin/com/wire/android/WireApplication.kt 0.00% <0.00%> (ø)

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 13d5576...b866f95. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 20, 2023

Test Results

611 tests  ±0   610 ✔️ ±0   6m 28s ⏱️ - 4m 39s
  88 suites ±0       1 💤 ±0 
  88 files   ±0       0 ±0 

Results for commit b866f95. ± Comparison against base commit 13d5576.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 873 succeeded.

The build produced the following APK's:

.penaltyDeath()
.build()
)
StrictMode.setVmPolicy(
Copy link
Contributor

Choose a reason for hiding this comment

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

Just out of curiosity, what's the VM policy for? emulators or images run in CI??

Copy link
Member Author

Choose a reason for hiding this comment

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

No no nothing related to CI..We are just setting in Virtual Machine what actions should be detected.

@AndroidBob
Copy link
Collaborator

Build 874 succeeded.

The build produced the following APK's:

import kotlinx.coroutines.launch

@Composable
private fun loadBiMap(imageUri: Uri): State<Bitmap?> {
Copy link
Member

@MohamadJaara MohamadJaara Sep 20, 2023

Choose a reason for hiding this comment

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

Can we set this as an extension function annotated with stable?

@Stable
suspend fun Context.loadBitMap(imageUri: Uri): State<Bitmap?> {
       return produceState<Bitmap?>(initialValue = null, imageUri) {
       withContext(Dispatchers.IO) {
            value = imageUri.toBitmap(this)
        }
}

Copy link
Member Author

@ohassine ohassine Sep 20, 2023

Choose a reason for hiding this comment

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

It will be hard to pass the returned value from this suspend function to the composable as a param

@github-actions
Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 878 succeeded.

The build produced the following APK's:

@ohassine ohassine added this pull request to the merge queue Sep 21, 2023
Merged via the queue into develop with commit 1277cd7 Sep 21, 2023
11 checks passed
@ohassine ohassine deleted the enable_penalty_death_on_strict_mode branch September 21, 2023 10:37
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.

6 participants