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
Conversation
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
MediaProjection-Berechtigung angefragt wird (z. B.GPT_OSS_120B).Gemma 3nundGemma 4), Screenshots aktivieren und die Berechtigung wie bei anderen multimodalen Modellen angefragt wird.Description
PhotoReasoningScreenso, dass vor dem Aufruf vonrequestMediaProjectionPermissionnuncurrentModel.supportsScreenshotgeprüft wird statt!isOfflineModel, und belässthuman-expertausgeschlossen, indemmodelName != "human-expert"erhalten bleibt (app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt).GEMMA_3N_E4B_ITexplizitsupportsScreenshot = 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).GPT_OSS_120BalssupportsScreenshot = false, sodass bei diesem Modell keine MediaProjection-Anfrage erfolgt.Testing
./gradlew :app:compileDebugKotlin; der Build konnte in dieser Umgebung nicht abgeschlossen werden, weil die Datei/workspace/ScreenOperator/local.propertiesfehlt, und deshalb die Projektkonfiguration fehlschlägt.Codex Task