Skip to content

Refactor Android permission prompt callback API#4509

Merged
shai-almog merged 1 commit intomasterfrom
codex/fix-checkforpermission-localization-issues
Feb 11, 2026
Merged

Refactor Android permission prompt callback API#4509
shai-almog merged 1 commit intomasterfrom
codex/fix-checkforpermission-localization-issues

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Reduce duplication and keep AndroidImplementation.java smaller by extracting the permission callback contract to a dedicated top-level type.
  • Make the native API consistent so both AndroidImplementation and AndroidNativeUtil use the same PermissionPromptCallback interface instead of two different nested definitions.
  • Ensure the permissionPromptCallback field is declared with the other static fields near the top of AndroidImplementation for clarity.

Description

  • Added a new top-level interface com.codename1.impl.android.PermissionPromptCallback in Ports/Android/src/com/codename1/impl/android/PermissionPromptCallback.java and removed the nested interface definitions.
  • Moved the static permissionPromptCallback field into the main static field section of AndroidImplementation and kept the existing setter/getter and prompt helpers (setPermissionPromptCallback, getPermissionPromptCallback, showPermissionPrompt, showPermissionMessage).
  • Simplified AndroidNativeUtil.setPermissionPromptCallback(...) to delegate directly to AndroidImplementation.setPermissionPromptCallback(...) and removed the adapter code.
  • Updated the demo snippet in docs/demos/android/.../PermissionSnippets.java to import and use the shared PermissionPromptCallback type.

Testing

  • Ran git diff --check to validate whitespace/formatting issues and it succeeded.
  • Ran git status --short as a sanity check on working tree changes and it succeeded.
  • Attempted the fast smoke test script ./scripts/fast-core-unit-smoke.sh with the Java 8 environment variables but it failed because the expected Java 8 runtime path is not present in this environment (failure due to missing JAVA_HOME).

Codex Task

@github-actions
Copy link

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

Developer Guide quality checks:

  • AsciiDoc linter: No issues found (report)
  • Vale: 18791 alert(s) (2767 errors, 6373 warnings, 9651 suggestions) (exit code 1) (report)
  • Image references: No unused images detected (report)

@github-actions
Copy link

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Collaborator Author

shai-almog commented Feb 11, 2026

Android screenshot updates

Compared 31 screenshots: 30 matched, 1 error.

  • graphics-fill-round-rect — comparison error. Comparison error: PNG chunk truncated before CRC while processing: /home/runner/work/_temp/cn1ss-TCTS1i/graphics-fill-round-rect.png

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-fill-round-rect.png in workflow artifacts.

Native Android coverage

  • 📊 Line coverage: 7.23% (3670/50793 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 5.63% (17994/319741), branch 2.71% (844/31101), complexity 3.35% (997/29725), method 5.92% (820/13843), class 9.68% (177/1828)
    • 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/712 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)

@shai-almog shai-almog merged commit ac4106a into master Feb 11, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant