Skip to content

Notifications and background execution modernization#5142

Open
shai-almog wants to merge 10 commits into
masterfrom
feature/notifications-background-modernization
Open

Notifications and background execution modernization#5142
shai-almog wants to merge 10 commits into
masterfrom
feature/notifications-background-modernization

Conversation

@shai-almog
Copy link
Copy Markdown
Collaborator

Modernizes the local-notification, push, background-execution and shared-content APIs across core + JavaSE + Android + iOS, with full simulator support and build automation. The iOS native path was verified by a local Xcode build that links end-to-end (** BUILD SUCCEEDED **, arm64 simulator).

What's added

Notifications (com.codename1.notifications)

  • Display.requestNotificationPermission(...) with NotificationPermissionRequest (provisional / critical / time-sensitive / POST_NOTIFICATIONS via a UNAuthorizationOptions-matching mask) and NotificationPermissionResult.
  • NotificationChannelBuilder (Android O+ runtime channels: importance, sound, vibration, lights, lockscreen visibility, group, badge) routed through Display.
  • LocalNotification enriched backward-compatibly: image attachment, multiple action buttons, addInputAction(...) quick reply, per-channel sound, grouping (+ summary), full-screen intent, time-sensitive, ongoing/progress, custom view, and asMessagingStyle(...) conversation style. All existing fields/getters/setters unchanged.
  • PushContent gains actionTitle so push and local-notification actions surface consistently.

Shared content (com.codename1.share.SharedContent)

Background execution (com.codename1.background)

  • BackgroundWork.schedule(WorkRequest.builder()...) with constraints (network / unmetered / charging / idle / battery-not-low / periodic / input data) -> Android JobScheduler, iOS BGTaskScheduler.
  • ForegroundService.start(...) (Android foreground service running a JVM task with a persistent notification).
  • BackgroundTask.scheduleProcessing(id, earliestBeginDate, ...) -> iOS BGProcessingTaskRequest.

Push topics

  • Push.subscribeToTopic(...) / unsubscribeFromTopic(...) -> FCM on Android; documented no-op on iOS (raw APNs has no topics).

Build automation

  • AndroidGradleBuilder: registers the JobScheduler service, and (gated by classpath scan) the foreground service + permission and the share-receiver intent filters; generated stub captures the app instance, flushes pending shared content, and routes action ids + quick-reply text into PushContent.
  • IPhoneBuilder: auto-adds the processing background mode, BGTaskSchedulerPermittedIdentifiers (ios.backgroundProcessingIds), and CN1ShareAppGroup (ios.shareAppGroup).
  • New IOSNotificationContentExtensionBuilder emits a .ios.appext notification content extension (custom-view notifications) following the Add ShareResult callback API + iOS Share Extension authoring helper #5036 pattern.
  • Equivalent builder edits mirrored to the private BuildDaemon repo.

Simulator

Full JavaSE support: a rich notification panel (image / actions / inline quick reply / progress) routing taps to LocalNotificationCallback + PushContent; functional background work / processing with live constraint gating; foreground service; and a new "Notifications and Background" Simulate menu (constraint toggles, run-work-now, channel inspector, shared-content injection).

Verification

  • Compiles: core, JavaSE, Android (JDK17), iOS port Java, Maven plugin.
  • iOS native: build-ios-app.sh (ParparVM translate) + xcodebuild (arm64 simulator) link end-to-end; the binary contains all new native symbols and the native-retained Java callbacks.
  • 26 new unit tests (LocalNotification enrichment, permission/channel, WorkRequest, SharedContent, PushContent parity, IOSNotificationContentExtensionBuilder).

Notes: no @since/version tags; ASCII-only sources; getImplementation() kept package-private (narrow Display delegators added).

🤖 Generated with Claude Code

shai-almog and others added 5 commits May 31, 2026 15:23
…ichment

Adds the cross-platform foundation for the notifications and background
execution modernization:

Core API (com.codename1.notifications): NotificationPermissionRequest /
Result / Callback, NotificationChannelBuilder; LocalNotification enriched
backward-compatibly with Action, MessagingStyle and fluent setters for
channel, group, full-screen, time-sensitive, ongoing, progress, custom
view, actions and quick-reply input actions.

com.codename1.share.SharedContent; com.codename1.background WorkRequest /
BackgroundWorker / BackgroundWork / ForegroundService / BackgroundTask;
Push.subscribeToTopic / unsubscribeFromTopic; Lifecycle.onReceivedSharedContent.

CodenameOneImplementation gains concrete safe-default methods (never
abstract, so third-party impls keep compiling) plus a cross-port running
application instance holder; Display delegators; PushContent actionTitle
parity for push and local notification actions.

JavaSE simulator: rich Swing notification panel (image, actions, inline
quick-reply, progress) routing taps back to LocalNotificationCallback and
PushContent; functional background work / processing with live constraint
gating; foreground service; a new "Notifications and Background" Simulate
menu (constraint toggles, run-work-now, channel inspector, shared content
injection); app instance captured in Executor.

Android: extended Bundle round-trip carrying all new fields (guarded so
in-flight alarms from older builds still parse), notification permission,
reflective channel register/delete/group, FCM topic subscribe/unsubscribe,
and enriched LocalNotificationPublisher rendering (grouping, ongoing,
progress, full-screen, time-sensitive, messaging style, channel).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…OS native

Android: action-button routing via per-action content-intent templates with
RemoteInput quick reply; constraint-aware background work and one-shot
processing via JobScheduler (CodenameOneJobService); foreground service
(CodenameOneForegroundService); receive-shared-content via
CodenameOneShareReceiverActivity with App-storage file hand-off and pending
delivery to the running app.

iOS: IOSNative gains sendLocalNotification2 (actions, group/thread,
time-sensitive interruption level, image attachment), requestNotificationPermission
(maps UNAuthorizationStatus to the granular result), BGTaskScheduler
register/submit/cancel, isBackgroundProcessingSupported and getPendingSharedContent.
IOSImplementation wires these plus constraint-aware work persisted for
cold-launch reconstruction, topics no-op, and shared content parsing.
GLAppDelegate registers permitted BGTask identifiers at launch and polls the
share App Group on activation. Non-void natives expose redundant base and
_R_ symbols so the link step succeeds regardless of the translator mangling.

iOS Java compiles; the native sources require an Xcode iOS-port build to verify.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tent extension

AndroidGradleBuilder: register the JobScheduler background-work service, and
(gated by classpath scan flags) the foreground service with FOREGROUND_SERVICE
permission and the share-receiver activity with SEND/SEND_MULTIPLE intent
filters (android.shareFilter hint). Generated stub now captures the app
instance, flushes pending shared content, and routes local notification action
ids and quick-reply text into PushContent.

IPhoneBuilder: auto-add the "processing" UIBackgroundMode and inject
BGTaskSchedulerPermittedIdentifiers (ios.backgroundProcessingIds) and the
CN1ShareAppGroup key (ios.shareAppGroup) so BGTaskScheduler and shared-content
delivery work.

New IOSNotificationContentExtensionBuilder emits a .ios.appext notification
content extension following the PR #5036 share-extension authoring pattern,
for custom-view notifications.

The equivalent AndroidGradleBuilder / IPhoneBuilder edits are mirrored into the
private BuildDaemon repository per the mirror requirement.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds core-unittests for the LocalNotification enrichment (actions, input
actions, messaging style, grouping, progress, fluent setters and backward
compatibility), the notification permission request/result and channel
builder, WorkRequest constraints, SharedContent, and PushContent actionTitle
parity. Adds a deterministic-output test for IOSNotificationContentExtensionBuilder
in the maven plugin. All 26 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…cation

Verified the iOS port by building and linking the HelloCodenameOne sample
end-to-end (ParparVM translate + xcodebuild, arm64 simulator, BUILD SUCCEEDED).
Three issues surfaced and were fixed:

- fireSharedContentReceived used java.lang.reflect + caught NoSuchMethodException,
  which ParparVM's iOS JavaAPI does not provide (missing header). Replaced the
  reflection with an instanceof Lifecycle dispatch (onReceivedSharedContent is a
  Lifecycle method, so this is both correct and complete) in the core impl and the
  Android impl.
- IOSImplementation.runBackgroundProcessing used String.split, which ParparVM does
  not emit for iOS. Switched to Util.split and replaced the raw control-byte
  separators with � / � escapes (ASCII-clean source).
- CodenameOne_GLAppDelegate.m called IOSNative natives without a visible prototype;
  added the generated IOSNative.h include and corrected the getPendingSharedContent
  symbol to the param-aware non-void mangling (..._java_lang_String_R_java_lang_String).

The linked arm64 binary contains all new native symbols and the native-retained
Java callbacks (notificationPermissionResult, runBackgroundProcessing,
fireSharedContentFromNative).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Cloudflare Preview

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented Jun 1, 2026

Compared 122 screenshots: 122 matched.

Native Android coverage

  • 📊 Line coverage: 12.90% (7687/59611 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 10.47% (38189/364844), branch 4.50% (1546/34386), complexity 5.50% (1812/32966), method 9.62% (1482/15413), class 15.70% (339/2159)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 12.90% (7687/59611 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 10.47% (38189/364844), branch 4.50% (1546/34386), complexity 5.50% (1812/32966), method 9.62% (1482/15413), class 15.70% (339/2159)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 984.000 ms
Base64 CN1 encode 395.000 ms
Base64 encode ratio (CN1/native) 0.401x (59.9% faster)
Base64 native decode 1469.000 ms
Base64 CN1 decode 359.000 ms
Base64 decode ratio (CN1/native) 0.244x (75.6% faster)
Image encode benchmark status skipped (SIMD unsupported)

…ugs)

- javase-simulator-tests (Ant builds with -source 1.7, which requires captured
  locals in inner classes to be final): made the `port` parameter final in
  SimulatorNotifications.buildAndShow.
- build-test SpotBugs:check (enforced on core via core-unittests): the two
  anonymous Runnables in CodenameOneImplementation.fireSharedContentReceived and
  startForegroundService didn't use the enclosing instance and tripped
  SIC_INNER_SHOULD_BE_STATIC_ANON. Converted both to named static nested classes
  (SharedContentDispatch, ForegroundServiceRunner).

Validated locally: core spotbugs:check BUILD SUCCESS; core/javase/android compile.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented Jun 1, 2026

Compared 11 screenshots: 11 matched.
✅ JavaSE simulator integration screenshots matched stored baselines.

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented Jun 1, 2026

JavaScript port screenshot updates

Compared 94 screenshots: 74 matched, 15 updated, 5 missing references.

  • AnimateHierarchyScreenshotTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    AnimateHierarchyScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as AnimateHierarchyScreenshotTest.png in workflow artifacts.

  • AnimateLayoutScreenshotTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    AnimateLayoutScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as AnimateLayoutScreenshotTest.png in workflow artifacts.

  • AnimateUnlayoutScreenshotTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    AnimateUnlayoutScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as AnimateUnlayoutScreenshotTest.png in workflow artifacts.

  • ComponentReplaceFadeScreenshotTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    ComponentReplaceFadeScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as ComponentReplaceFadeScreenshotTest.png in workflow artifacts.

  • ComponentReplaceSlideScreenshotTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    ComponentReplaceSlideScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as ComponentReplaceSlideScreenshotTest.png in workflow artifacts.

  • CoverHorizontalTransitionTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    CoverHorizontalTransitionTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as CoverHorizontalTransitionTest.png in workflow artifacts.

  • FadeTransitionTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    FadeTransitionTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as FadeTransitionTest.png in workflow artifacts.

  • MorphTransitionScrolledSourceTest — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/MorphTransitionScrolledSourceTest.png.

    MorphTransitionScrolledSourceTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as MorphTransitionScrolledSourceTest.png in workflow artifacts.

  • MorphTransitionSnapshotTest — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/MorphTransitionSnapshotTest.png.

    MorphTransitionSnapshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as MorphTransitionSnapshotTest.png in workflow artifacts.

  • MorphTransitionTest — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/MorphTransitionTest.png.

    MorphTransitionTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as MorphTransitionTest.png in workflow artifacts.

  • MotionShowcaseScreenshotTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    MotionShowcaseScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as MotionShowcaseScreenshotTest.png in workflow artifacts.

  • PullToRefreshSpinnerScreenshotTest — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/PullToRefreshSpinnerScreenshotTest.png.

    PullToRefreshSpinnerScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as PullToRefreshSpinnerScreenshotTest.png in workflow artifacts.

  • SheetSlideUpAnimationScreenshotTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    SheetSlideUpAnimationScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as SheetSlideUpAnimationScreenshotTest.png in workflow artifacts.

  • SlideFadeTitleTransitionTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    SlideFadeTitleTransitionTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as SlideFadeTitleTransitionTest.png in workflow artifacts.

  • SlideHorizontalBackTransitionTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    SlideHorizontalBackTransitionTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as SlideHorizontalBackTransitionTest.png in workflow artifacts.

  • SlideHorizontalTransitionTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    SlideHorizontalTransitionTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as SlideHorizontalTransitionTest.png in workflow artifacts.

  • SlideVerticalTransitionTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    SlideVerticalTransitionTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as SlideVerticalTransitionTest.png in workflow artifacts.

  • SmoothScrollScreenshotTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    SmoothScrollScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as SmoothScrollScreenshotTest.png in workflow artifacts.

  • TabsAnimatedIndicatorScreenshotTest — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/TabsAnimatedIndicatorScreenshotTest.png.

    TabsAnimatedIndicatorScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as TabsAnimatedIndicatorScreenshotTest.png in workflow artifacts.

  • UncoverHorizontalTransitionTest — updated screenshot. Screenshot differs (375x667 px, bit depth 8).

    UncoverHorizontalTransitionTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as UncoverHorizontalTransitionTest.png in workflow artifacts.

- ClassWithOnlyPrivateConstructorsShouldBeFinal: made BackgroundWork,
  BackgroundTask and ForegroundService final.
- MissingOverride: added @OverRide to run() in the SharedContentDispatch and
  ForegroundServiceRunner static nested classes.
@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented Jun 1, 2026

Compared 122 screenshots: 122 matched.
✅ Native Mac screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 177 seconds

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 649.000 ms
Base64 CN1 encode 1239.000 ms
Base64 encode ratio (CN1/native) 1.909x (90.9% slower)
Base64 native decode 363.000 ms
Base64 CN1 decode 1213.000 ms
Base64 decode ratio (CN1/native) 3.342x (234.2% slower)
Base64 SIMD encode 487.000 ms
Base64 encode ratio (SIMD/native) 0.750x (25.0% faster)
Base64 encode ratio (SIMD/CN1) 0.393x (60.7% faster)
Base64 SIMD decode 552.000 ms
Base64 decode ratio (SIMD/native) 1.521x (52.1% slower)
Base64 decode ratio (SIMD/CN1) 0.455x (54.5% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 83.000 ms
Image createMask (SIMD on) 23.000 ms
Image createMask ratio (SIMD on/off) 0.277x (72.3% faster)
Image applyMask (SIMD off) 203.000 ms
Image applyMask (SIMD on) 131.000 ms
Image applyMask ratio (SIMD on/off) 0.645x (35.5% faster)
Image modifyAlpha (SIMD off) 194.000 ms
Image modifyAlpha (SIMD on) 103.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.531x (46.9% faster)
Image modifyAlpha removeColor (SIMD off) 207.000 ms
Image modifyAlpha removeColor (SIMD on) 144.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.696x (30.4% faster)
Image PNG encode (SIMD off) 1375.000 ms
Image PNG encode (SIMD on) 895.000 ms
Image PNG encode ratio (SIMD on/off) 0.651x (34.9% faster)
Image JPEG encode 592.000 ms

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented Jun 1, 2026

Compared 122 screenshots: 122 matched.
✅ Native iOS Metal screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 268 seconds

Build and Run Timing

Metric Duration
Simulator Boot 99000 ms
Simulator Boot (Run) 2000 ms
App Install 17000 ms
App Launch 60000 ms
Test Execution 270000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 1062.000 ms
Base64 CN1 encode 2018.000 ms
Base64 encode ratio (CN1/native) 1.900x (90.0% slower)
Base64 native decode 422.000 ms
Base64 CN1 decode 1471.000 ms
Base64 decode ratio (CN1/native) 3.486x (248.6% slower)
Base64 SIMD encode 473.000 ms
Base64 encode ratio (SIMD/native) 0.445x (55.5% faster)
Base64 encode ratio (SIMD/CN1) 0.234x (76.6% faster)
Base64 SIMD decode 578.000 ms
Base64 decode ratio (SIMD/native) 1.370x (37.0% slower)
Base64 decode ratio (SIMD/CN1) 0.393x (60.7% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 59.000 ms
Image createMask (SIMD on) 11.000 ms
Image createMask ratio (SIMD on/off) 0.186x (81.4% faster)
Image applyMask (SIMD off) 196.000 ms
Image applyMask (SIMD on) 148.000 ms
Image applyMask ratio (SIMD on/off) 0.755x (24.5% faster)
Image modifyAlpha (SIMD off) 271.000 ms
Image modifyAlpha (SIMD on) 111.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.410x (59.0% faster)
Image modifyAlpha removeColor (SIMD off) 603.000 ms
Image modifyAlpha removeColor (SIMD on) 186.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.308x (69.2% faster)
Image PNG encode (SIMD off) 1463.000 ms
Image PNG encode (SIMD on) 1346.000 ms
Image PNG encode ratio (SIMD on/off) 0.920x (8.0% faster)
Image JPEG encode 824.000 ms

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ByteCodeTranslator: 0 findings (no issues)
    • android: 0 findings (no issues)
    • codenameone-maven-plugin: 0 findings (no issues)
    • core-unittests: 0 findings (no issues)
    • ios: 0 findings (no issues)
  • PMD: 0 findings (no issues) [Report archive]
  • Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

The IOSNative background-processing bridge references BGTaskScheduler /
BGProcessingTaskRequest unconditionally. Local builds resolved them via clang
module auto-linking, but the CI iOS link (run-ios-ui-tests) does not auto-link,
so it failed with "Undefined symbols: _OBJC_CLASS_$_BGTaskScheduler,
_OBJC_CLASS_$_BGProcessingTaskRequest". Add BackgroundTasks.framework to the iOS
link (addLibs), mirroring how UserNotifications.framework is linked.

Validated locally: generated project links BackgroundTasks.framework and the
arm64 simulator build links cleanly (BUILD SUCCEEDED). Mirrored to the BuildDaemon
IPhoneBuilder.
@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented Jun 1, 2026

Compared 122 screenshots: 122 matched.
✅ Native iOS screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 216 seconds

Build and Run Timing

Metric Duration
Simulator Boot 65000 ms
Simulator Boot (Run) 1000 ms
App Install 12000 ms
App Launch 5000 ms
Test Execution 350000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 743.000 ms
Base64 CN1 encode 1386.000 ms
Base64 encode ratio (CN1/native) 1.865x (86.5% slower)
Base64 native decode 370.000 ms
Base64 CN1 decode 922.000 ms
Base64 decode ratio (CN1/native) 2.492x (149.2% slower)
Base64 SIMD encode 391.000 ms
Base64 encode ratio (SIMD/native) 0.526x (47.4% faster)
Base64 encode ratio (SIMD/CN1) 0.282x (71.8% faster)
Base64 SIMD decode 376.000 ms
Base64 decode ratio (SIMD/native) 1.016x (1.6% slower)
Base64 decode ratio (SIMD/CN1) 0.408x (59.2% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 82.000 ms
Image createMask (SIMD on) 12.000 ms
Image createMask ratio (SIMD on/off) 0.146x (85.4% faster)
Image applyMask (SIMD off) 162.000 ms
Image applyMask (SIMD on) 100.000 ms
Image applyMask ratio (SIMD on/off) 0.617x (38.3% faster)
Image modifyAlpha (SIMD off) 195.000 ms
Image modifyAlpha (SIMD on) 102.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.523x (47.7% faster)
Image modifyAlpha removeColor (SIMD off) 175.000 ms
Image modifyAlpha removeColor (SIMD on) 131.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.749x (25.1% faster)
Image PNG encode (SIMD off) 1061.000 ms
Image PNG encode (SIMD on) 838.000 ms
Image PNG encode ratio (SIMD on/off) 0.790x (21.0% faster)
Image JPEG encode 589.000 ms

… receiver

CodenameOneShareReceiverActivity.addStream had three SpotBugs findings:
- RV_RETURN_VALUE_IGNORED_BAD_PRACTICE: File.mkdirs() return ignored.
- OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE / OS_OPEN_STREAM_EXCEPTION_PATH: the
  input/output streams could leak on exception paths (opened before the try, and
  the finally closed them in a way that could skip one if the other threw).

Rewrote to declare both streams up front (null), check mkdirs(), and close each
independently in a finally with its own try/catch. Verified locally: android port
compiles and spotbugs reports total_bugs=0 (555 classes analyzed), with the three
findings gone.

Note: Android spotbugs:check is not currently gated in CI (only core-unittests
enforces it), which is why these were reported as warnings rather than failing
the build.
The quality-report gate applies forbidden_rules to every SpotBugs report
(core-unittests, android, ios, plugin, ByteCodeTranslator), but
RV_RETURN_VALUE_IGNORED_BAD_PRACTICE, OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE
and OS_OPEN_STREAM_EXCEPTION_PATH were not in the set, so the share-receiver
findings were reported as warnings instead of failing the build. Add the three
rules to forbidden_rules.

Verified all five analyzed modules currently report zero occurrences of these
rules (so this does not surface pre-existing failures), and the gate will now
catch ignored return values and unclosed-stream-on-exception bugs anywhere in
core or the ports.
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.

1 participant