Skip to content

marked acquireWakeLockNow as static as it was static before#49875

Closed
mstrokin wants to merge 3 commits into
facebook:mainfrom
mstrokin:fix/acquirewakelock
Closed

marked acquireWakeLockNow as static as it was static before#49875
mstrokin wants to merge 3 commits into
facebook:mainfrom
mstrokin:fix/acquirewakelock

Conversation

@mstrokin
Copy link
Copy Markdown
Contributor

@mstrokin mstrokin commented Mar 6, 2025

Summary:

acquireWakeLockNow was static before but wasn't marked as static in 9afad52 when changing code to Kotlin.

This breaks react-native-firebase but I've submitted the bug report there as I guess it might be fixed there too.

Changelog:

[ANDROID] [FIXED] - Marked acquireWakeLockNow as static

Test plan:

No tests as it reverts the broken change

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Mar 6, 2025
@mikehardy
Copy link
Copy Markdown
Contributor

This looks right to me - was clearly static before:

9afad52#diff-a794349a87c640230f45e4ef37cc183713fc8dda05348e033027e6fde3a647eeL31

@cipolleschi this looks like the right direction for the API fix though I haven't tested it yet

@cipolleschi
Copy link
Copy Markdown
Contributor

cipolleschi commented Mar 6, 2025

@cortinico can you take this?

Changing the ReactAndroid.api won't fix the issue. that file is generated from the source code.
You'll have to update the HeadlessJsTaskService.kt to make sure that acquireWakeLockNow is static again. I'm not a Kotlin expert, so I'm not sure how to achieve it.

@mstrokin
Copy link
Copy Markdown
Contributor Author

mstrokin commented Mar 6, 2025

Sorry, didn't notice it's a generated file, I've added @JvmStatic annotation so that Kotlin generates static function properly.

@alanleedev alanleedev requested a review from cortinico March 7, 2025 00:13
@mstrokin
Copy link
Copy Markdown
Contributor Author

mstrokin commented Mar 7, 2025

Added fixed .api file (generated by binary-compatibility-validator)

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Mar 7, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@javache merged this pull request in 2a58201.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @mstrokin in 2a58201

When will my fix make it into a release? | How to file a pick request?

@mikehardy
Copy link
Copy Markdown
Contributor

You guys are awesome - @mstrokin - 🏆 for fixing a problem before it's even a problem (nailing it while in RC phase...), @cipolleschi 🏆 for the focused suggestion to finalize it. Boom. Really appreciate it over in react-native-firebase land

@mikehardy
Copy link
Copy Markdown
Contributor

Just tried a build with 0.79.0-rc.2 and it failed, the fix here appears good but there does not appear to be a pick request for the 0.79 branch and I suppose this was merged post-branch cut

reactwg/react-native-releases#845

react-native-bot pushed a commit that referenced this pull request Mar 18, 2025
Summary:
acquireWakeLockNow was static before but wasn't marked as static in 9afad52  when changing code to Kotlin.

This breaks react-native-firebase but I've submitted the bug report there as I guess it might be fixed there too.

## Changelog:

[ANDROID] [FIXED] - Marked acquireWakeLockNow as static

Pull Request resolved: #49875

Test Plan: No tests as it reverts the broken change

Reviewed By: rshest

Differential Revision: D70773675

Pulled By: javache

fbshipit-source-id: d7363702dfec078b7e6d2693d05b8ab87e818522
@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @mstrokin in 6699563

When will my fix make it into a release? | How to file a pick request?

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants