Skip to content

Add a StrictMode noteSlowCall for SSL init#8339

Merged
yschimke merged 9 commits into
lysine-dev:masterfrom
yschimke:OkHttp-warning
Jan 5, 2025
Merged

Add a StrictMode noteSlowCall for SSL init#8339
yschimke merged 9 commits into
lysine-dev:masterfrom
yschimke:OkHttp-warning

Conversation

@yschimke

@yschimke yschimke commented Apr 6, 2024

Copy link
Copy Markdown
Collaborator

Apps may want to defer SSL init off the main thread, so warn if they have enabled Strict Mode.

Alternative or precursor to #8248, should land which ever way that goes.

@yschimke yschimke added the android Relates to usage specifically on Android label Apr 6, 2024
@yschimke
yschimke requested a review from swankjesse April 6, 2024 10:58
@yschimke

Copy link
Copy Markdown
Collaborator Author

@swankjesse if we don't do #8248, then we should be noisy when it's used on main.

@yschimke

Copy link
Copy Markdown
Collaborator Author

@swankjesse any objections to this?

@yschimke
yschimke requested a review from JakeWharton January 4, 2025 10:08
Comment on lines +63 to +65
.penaltyListener({ it.run() }) {
violations.add(it)
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hmmm. When was this added? I would assume after our minSdk, so it should really have an @SdkSuppress(minSdk=something) on the class.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'll check, also why it's not failing if so.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ahhh, just the tests. And not running because of mannodermaus/android-junit-framework#225 and a minSdk 26 requirement for tests.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ah. JUnit 5 continues to prove that it's the wrong choice for any project.

@yschimke
yschimke merged commit 9c653c7 into lysine-dev:master Jan 5, 2025
@yschimke
yschimke deleted the OkHttp-warning branch August 2, 2025 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

android Relates to usage specifically on Android

Development

Successfully merging this pull request may close these issues.

2 participants