File tree Expand file tree Collapse file tree
app/src/main/kotlin/com/google/ai/sample Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ enum class ModelOption(
5656 ApiProvider .GOOGLE ,
5757 " https://huggingface.co/na5h13/gemma-3n-E4B-it-litert-lm/resolve/main/gemma-3n-E4B-it-int4.litertlm?download=true" ,
5858 " 4.92 GB" ,
59+ supportsScreenshot = true ,
5960 isOfflineModel = true ,
6061 offlineModelFilename = " gemma-3n-e4b-it-int4.litertlm" ,
6162 offlineRequiredFilenames = listOf (" gemma-3n-e4b-it-int4.litertlm" )
Original file line number Diff line number Diff line change @@ -406,9 +406,10 @@ fun PhotoReasoningScreen(
406406 return @IconButton
407407 }
408408
409- // Check MediaProjection for all models except offline and human-expert
410- // Human Expert uses its own MediaProjection for WebRTC, not ScreenCaptureService
411- if (! isMediaProjectionPermissionGranted && ! com.google.ai.sample.GenerativeAiViewModelFactory .getCurrentModel().isOfflineModel && modelName != " human-expert" ) {
409+ // Check MediaProjection only for models that support screenshots and are not human-expert.
410+ // Human Expert uses its own MediaProjection for WebRTC, not ScreenCaptureService.
411+ val currentModel = com.google.ai.sample.GenerativeAiViewModelFactory .getCurrentModel()
412+ if (! isMediaProjectionPermissionGranted && currentModel.supportsScreenshot && modelName != " human-expert" ) {
412413 mainActivity?.requestMediaProjectionPermission {
413414 // This block will be executed after permission is granted
414415 if (userQuestion.isNotBlank()) {
You can’t perform that action at this time.
0 commit comments