Skip to content

MediaProjection-Anfrage nur für Modelle mit Screenshot-Unterstützung#80

Open
Android-PowerUser wants to merge 4 commits intofix-qwen-3.5-offline-model-initialization-errorfrom
update-mediaprojection-permissions-handling
Open

MediaProjection-Anfrage nur für Modelle mit Screenshot-Unterstützung#80
Android-PowerUser wants to merge 4 commits intofix-qwen-3.5-offline-model-initialization-errorfrom
update-mediaprojection-permissions-handling

Conversation

@Android-PowerUser
Copy link
Copy Markdown
Owner

Motivation

  • Vermeiden, dass bei Modellen ohne Bild-/Screenshot-Unterstützung unnötig die MediaProjection-Berechtigung angefragt wird (z. B. GPT_OSS_120B).
  • Sicherstellen, dass offline Gemma-Modelle, die Bilder unterstützen (z. B. Gemma 3n und Gemma 4), Screenshots aktivieren und die Berechtigung wie bei anderen multimodalen Modellen angefragt wird.

Description

  • Ändert die Prüfbedingung in PhotoReasoningScreen so, dass vor dem Aufruf von requestMediaProjectionPermission nun currentModel.supportsScreenshot geprüft wird statt !isOfflineModel, und belässt human-expert ausgeschlossen, indem modelName != "human-expert" erhalten bleibt (app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt).
  • Setzt für das Offline-Modell GEMMA_3N_E4B_IT explizit supportsScreenshot = true, damit die Screenshot-/Bild-Logik und die MediaProjection-Anfrage für dieses Modell wie gewünscht ausgeführt werden (app/src/main/kotlin/com/google/ai/sample/GenerativeAiViewModelFactory.kt).
  • Belässt GPT_OSS_120B als supportsScreenshot = false, sodass bei diesem Modell keine MediaProjection-Anfrage erfolgt.

Testing

  • Versucht: ./gradlew :app:compileDebugKotlin; der Build konnte in dieser Umgebung nicht abgeschlossen werden, weil die Datei /workspace/ScreenOperator/local.properties fehlt, und deshalb die Projektkonfiguration fehlschlägt.
  • Keine weiteren automatisierten Tests wurden ausgeführt; die Änderungen sind klein und beschränken sich auf Feature-Flags und Bedingungslogik in zwei Dateien.

Codex Task

Copy link
Copy Markdown
Contributor

@amazon-q-developer amazon-q-developer bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes correctly implement the MediaProjection permission handling based on screenshot support. The logic now properly checks supportsScreenshot instead of isOfflineModel, enabling screenshot functionality for offline models that support it (like Gemma 3n) while avoiding unnecessary permission requests for models without screenshot support (like GPT-OSS 120B).


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

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