mirror of
https://github.com/bulwarkmail/native.git
synced 2026-10-31 16:06:32 +00:00
react-native-android-widget registers every button's PendingIntent with the current time in milliseconds as its request code and FLAG_CANCEL_CURRENT. All buttons of a widget share the same action and provider, so the request code is the only thing telling them apart: two buttons registered within one millisecond got the same intent, and the second registration cancelled the first. That button then did nothing when tapped. The emulator takes 3-10 ms per button, a current phone well under one, so which button died depended on timing. The library is patched with patch-package (run on postinstall) to hand out request codes that count up from the time, unique in the process and clear of the codes an earlier process left on the launcher. The patch keeps the library's CRLF line endings, hence `-text` for `patches/*.patch`.