Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

Added Display.notifyPushCompletion() and updated IOSImplementation to support manual push completion handling on iOS.
This allows developers to delay the OS notification that the push has been processed, enabling background tasks such as playing audio to complete.
The functionality is controlled by the ios.delayPushCompletion build hint.
Also updated Display and CodenameOneImplementation to include the new method.


PR created automatically by Jules for task 10512632328374437039 started by @shai-almog

Added Display.notifyPushCompletion() to allow applications to manually signal when they have finished handling a push notification on iOS.
This is useful for apps that need to perform background tasks (like playing audio) before the app is suspended.
This feature is enabled by setting the build hint `ios.delayPushCompletion` to `true`.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

Added Display.notifyPushCompletion() to allow applications to manually signal when they have finished handling a push notification on iOS.
This is useful for apps that need to perform background tasks (like playing audio) before the app is suspended.
This feature is enabled by setting the build hint `ios.delayPushCompletion` to `true`.
@github-actions
Copy link

github-actions bot commented Dec 22, 2025

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Collaborator

shai-almog commented Dec 22, 2025

Compared 30 screenshots: 30 matched.

Native Android coverage

  • 📊 Line coverage: 24.61% (2636/10710 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 24.30% (12273/50499), branch 15.30% (714/4668), complexity 17.39% (737/4237), method 32.67% (594/1818), class 34.65% (105/303)
    • Lowest covered classes
      • com.codename1.impl.android.com.codename1.impl.android.AndroidContactsManager – 0.00% (0/400 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$Video – 0.00% (0/168 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.IntentIntegrator – 0.00% (0/139 lines covered)
      • com.codename1.impl.android.util.com.codename1.impl.android.util.Base64 – 0.00% (0/117 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$SocketImpl – 0.00% (0/77 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidTextureView – 0.00% (0/76 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidSurfaceView – 0.00% (0/73 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.LocalNotificationPublisher – 0.00% (0/65 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.FridaDetectionUtil – 0.00% (0/64 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.PushNotificationService – 0.00% (0/59 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 24.61% (2636/10710 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 24.30% (12273/50499), branch 15.30% (714/4668), complexity 17.39% (737/4237), method 32.67% (594/1818), class 34.65% (105/303)
    • Lowest covered classes
      • com.codename1.impl.android.com.codename1.impl.android.AndroidContactsManager – 0.00% (0/400 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$Video – 0.00% (0/168 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.IntentIntegrator – 0.00% (0/139 lines covered)
      • com.codename1.impl.android.util.com.codename1.impl.android.util.Base64 – 0.00% (0/117 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$SocketImpl – 0.00% (0/77 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidTextureView – 0.00% (0/76 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidSurfaceView – 0.00% (0/73 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.LocalNotificationPublisher – 0.00% (0/65 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.FridaDetectionUtil – 0.00% (0/64 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.PushNotificationService – 0.00% (0/59 lines covered)

@shai-almog
Copy link
Collaborator

shai-almog commented Dec 22, 2025

iOS screenshot updates

Compared 30 screenshots: 23 matched, 6 updated, 1 missing reference.

  • BrowserComponent — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    BrowserComponent
    Preview info: Preview provided by instrumentation.
    Full-resolution PNG saved as BrowserComponent.png in workflow artifacts.

  • graphics-draw-arc — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-arc
    Preview info: JPEG preview quality 20; JPEG preview quality 20; downscaled to 603x1311.
    Full-resolution PNG saved as graphics-draw-arc.png in workflow artifacts.

  • graphics-draw-gradient — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-gradient
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 844x1835.
    Full-resolution PNG saved as graphics-draw-gradient.png in workflow artifacts.

  • graphics-draw-round-rect — missing reference. Reference screenshot missing at /Users/runner/work/CodenameOne/CodenameOne/scripts/ios/screenshots/graphics-draw-round-rect.png.

    graphics-draw-round-rect
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 844x1835.
    Full-resolution PNG saved as graphics-draw-round-rect.png in workflow artifacts.

  • graphics-draw-string — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-string
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 422x918.
    Full-resolution PNG saved as graphics-draw-string.png in workflow artifacts.

  • graphics-draw-string-decorated — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-string-decorated
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 603x1311.
    Full-resolution PNG saved as graphics-draw-string-decorated.png in workflow artifacts.

  • kotlin — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    kotlin
    Preview info: Preview provided by instrumentation.
    Full-resolution PNG saved as kotlin.png in workflow artifacts.

Benchmark Results

  • VM Translation Time: 326 seconds
  • Compilation Time: 143 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 31421 ms
Extract Extensions 17 ms
Google Services Setup 4 ms
Scan Classes 797 ms
Extract Libs 1322 ms
Inject Build Hints 45 ms
Generate Unit Tests 8 ms
Generate Stubs 1118 ms
Compile Stubs 2524 ms
Generate Icons 1132 ms
Prepare ParparVM 198 ms
ParparVM Execution 183125 ms
Post-VM Setup 175 ms
CocoaPods 6610 ms
Finalize 30 ms
Total Time 228527 msMaven Overhead : 98000 ms
CocoaPods Install (Script) 1000 ms
Simulator Boot (Run) 65000 ms
App Install 19000 ms
App Launch 12000 ms
Test Execution 200000 ms

Added Display.notifyPushCompletion() to manually signal the completion of a background push task (e.g. playing audio).
On iOS, this delays the call to the system completion handler if the `ios.delayPushCompletion` or `delayPushCompletion` property is set.
On Android, this releases a partial WakeLock acquired when the push is received, preventing the device from sleeping during the task if the `android.delayPushCompletion` or `delayPushCompletion` property is set.
Updated `IOSImplementation`, `AndroidImplementation`, and `PushNotificationService` to support this logic.
…s (opt-in).

Added Display.notifyPushCompletion() to manually signal the completion of a background push task.
This mechanism is OPT-IN via the `delayPushCompletion` (or `android.delayPushCompletion`/`ios.delayPushCompletion`) build hint.

If the hint is present and true:
- Android: Acquires a `PARTIAL_WAKE_LOCK` upon receiving a push, preventing the device from sleeping until `notifyPushCompletion()` is called (or timeout).
- iOS: Ensures the `remote-notification` background mode is enabled and delays firing the system completion handler until `notifyPushCompletion()` is called.

If the hint is NOT present (default behavior):
- Android: No wake lock is acquired.
- iOS: The completion handler is fired immediately after the push callback.

Updated `IOSImplementation`, `AndroidImplementation`, `PushNotificationService`, `AndroidGradleBuilder`, and `IPhoneBuilder`.
…s (opt-in).

Added Display.notifyPushCompletion() to manually signal the completion of a background push task.
This mechanism is OPT-IN via the `delayPushCompletion` (or `android.delayPushCompletion`/`ios.delayPushCompletion`) build hint.

If the hint is present and true:
- Android: Acquires a `PARTIAL_WAKE_LOCK` upon receiving a push, preventing the device from sleeping until `notifyPushCompletion()` is called (or timeout).
- iOS: Ensures the `remote-notification` background mode is enabled and delays firing the system completion handler until `notifyPushCompletion()` is called.

The builders (`IPhoneBuilder`, `AndroidGradleBuilder`) have been updated to check for this hint and automatically:
1. Inject the permission (Android) or capability (iOS) into the native project configuration.
2. Inject the `delayPushCompletion` property into the runtime environment so the logic in `PushNotificationService` and `IOSImplementation` activates.

Updated the developer guide to document this new feature.
@github-actions
Copy link

github-actions bot commented Dec 23, 2025

Developer Guide build artifacts are available for download from this workflow run:

Developer Guide quality checks:

  • AsciiDoc linter: No issues found (report)
  • Vale: 18754 alert(s) (2764 errors, 6363 warnings, 9627 suggestions) (exit code 1) (report)
  • Image references: No unused images detected (report)

Corrected the placement of `notifyPushCompletion()` in `AndroidImplementation.java` to resolve the "java.lang.Override is not a repeatable annotation type" error caused by improper nesting with `notifyCommandBehavior`.

This completes the cross-platform push completion support feature, which is OPT-IN via the `delayPushCompletion` build hint.

If the hint is present and true:
- Android: Acquires a `PARTIAL_WAKE_LOCK` upon receiving a push, releasing it only when `notifyPushCompletion()` is called.
- iOS: Delays firing the system completion handler until `notifyPushCompletion()` is called.

Builders have been updated to inject the necessary permissions and runtime properties.
Developer guide documentation has been updated.
@shai-almog shai-almog marked this pull request as ready for review December 23, 2025 18:24
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@shai-almog shai-almog merged commit 675f9f7 into master Dec 23, 2025
17 of 18 checks passed
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.

2 participants