Skip to content

Build arm64#5

Open
edianio wants to merge 3 commits into
masterfrom
issue2937
Open

Build arm64#5
edianio wants to merge 3 commits into
masterfrom
issue2937

Conversation

@edianio

@edianio edianio commented Jun 8, 2026

Copy link
Copy Markdown

Atualiza o fork para permitir build em arquitetura arm64(simulador iOS ).

close https://github.com/StudioSol/PalcoMobile/issues/2937

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Flutter Cast Framework, introducing active cast discovery and multicast lock management on Android to prevent discovery failures on certain devices. It also updates dependencies, raises the iOS deployment target to 13.0, and standardizes default receiver IDs across platforms. Feedback on these changes highlights a potential battery drain issue in FlutterCastFrameworkPlugin.kt where a multicast lock is acquired before validating the selector, and notes that ephemeral LLDB files under the example/ios/Flutter/ephemeral/ directory should be removed from version control.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +51 to +65
private fun startActiveDiscovery(context: Context, castContext: CastContext) {
try {
acquireMulticastLock(context)
val mediaRouter = mMediaRouter ?: MediaRouter.getInstance(context).also { mMediaRouter = it }
val selector = castContext.mergedSelector ?: return
mediaRouter.addCallback(
selector,
mMediaRouterCallback,
MediaRouter.CALLBACK_FLAG_PERFORM_ACTIVE_SCAN
)
Log.d(TAG, "Active cast discovery started")
} catch (e: Exception) {
Log.e(TAG, "Failed to start active cast discovery", e)
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

O acquireMulticastLock(context) é chamado antes da verificação de nulidade de castContext.mergedSelector. Se mergedSelector for nulo, o método retorna antecipadamente, mas o MulticastLock permanece ativo sem que nenhuma descoberta ativa esteja ocorrendo. Isso pode causar um consumo desnecessário de bateria, pois impede que o chip Wi-Fi entre no modo de baixo consumo. Recomenda-se mover a chamada de acquireMulticastLock(context) para depois da verificação de nulidade do selector.

Suggested change
private fun startActiveDiscovery(context: Context, castContext: CastContext) {
try {
acquireMulticastLock(context)
val mediaRouter = mMediaRouter ?: MediaRouter.getInstance(context).also { mMediaRouter = it }
val selector = castContext.mergedSelector ?: return
mediaRouter.addCallback(
selector,
mMediaRouterCallback,
MediaRouter.CALLBACK_FLAG_PERFORM_ACTIVE_SCAN
)
Log.d(TAG, "Active cast discovery started")
} catch (e: Exception) {
Log.e(TAG, "Failed to start active cast discovery", e)
}
}
private fun startActiveDiscovery(context: Context, castContext: CastContext) {
try {
val selector = castContext.mergedSelector ?: return
acquireMulticastLock(context)
val mediaRouter = mMediaRouter ?: MediaRouter.getInstance(context).also { mMediaRouter = it }
mediaRouter.addCallback(
selector,
mMediaRouterCallback,
MediaRouter.CALLBACK_FLAG_PERFORM_ACTIVE_SCAN
)
Log.d(TAG, "Active cast discovery started")
} catch (e: Exception) {
Log.e(TAG, "Failed to start active cast discovery", e)
}
}

@@ -0,0 +1,32 @@
#

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Este arquivo está localizado no diretório ephemeral, que é gerado dinamicamente pelo Flutter durante o build e não deve ser adicionado ao controle de versão. Recomenda-se remover este arquivo do commit e garantir que o diretório ios/Flutter/ephemeral/ esteja listado no seu arquivo .gitignore.

@@ -0,0 +1,5 @@
#

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Este arquivo está localizado no diretório ephemeral, que é gerado dinamicamente pelo Flutter durante o build e não deve ser adicionado ao controle de versão. Recomenda-se remover este arquivo do commit e garantir que o diretório ios/Flutter/ephemeral/ esteja listado no seu arquivo .gitignore.

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.

1 participant