Skip to content

Revert "Gemini live launching and font updates"#174

Merged
kathleenalexandra24 merged 1 commit into
prototype-ai-glassesfrom
revert-171-feature/live-launching-font
May 29, 2026
Merged

Revert "Gemini live launching and font updates"#174
kathleenalexandra24 merged 1 commit into
prototype-ai-glassesfrom
revert-171-feature/live-launching-font

Conversation

@kathleenalexandra24
Copy link
Copy Markdown

Reverts #171

@kathleenalexandra24 kathleenalexandra24 merged commit da3df0d into prototype-ai-glasses May 29, 2026
1 check passed
Copy link
Copy Markdown
Contributor

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

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 integrates multiple new AI samples into the catalog, updates SDK and dependency versions (including upgrading AGP to 9.2.0 and Kotlin to 2.2.10), and cleans up redundant configurations and dependencies. However, critical issues were identified in the review: upgrading Kotlin to 2.2.10 without updating KSP will cause a build failure due to version mismatch. Additionally, removing the onStop lifecycle hook in GlassesActivity and the corresponding stopLiveSession() method in TodoScreenViewModel prevents the release of high-drain resources like the microphone, leading to potential background resource leaks, battery drain, and privacy concerns.

I am having trouble creating individual review comments. Click here to see my feedback.

gradle/libs.versions.toml (8)

critical

Upgrading Kotlin to 2.2.10 while keeping KSP at 2.1.0-1.0.29 will cause a build failure because KSP versions are strictly tied to the Kotlin compiler version. Please either revert Kotlin to 2.1.0 or upgrade KSP to a version compatible with Kotlin 2.2.10 (e.g., 2.2.10-1.0.30 or similar).

kotlin = "2.1.0"

samples/gemini-live-todo/src/main/java/com/android/ai/samples/geminilivetodo/GlassesActivity.kt (133-138)

security-high high

Reverting the onStop lifecycle hook that stops the live session is a critical issue. Without releasing high-drain resources like the microphone and the active audio connection in onStop, the live session will continue running in the background when the activity is no longer visible. This leads to severe battery drain and presents a significant privacy risk as the microphone remains active.

Please restore the onStop implementation:

override fun onStop() {
    super.onStop()
    viewModel.stopLiveSession()
}

samples/gemini-live-todo/src/main/java/com/android/ai/samples/geminilivetodo/ui/TodoScreenViewModel.kt (321-331)

high

Removing stopLiveSession() prevents the UI layer (such as GlassesActivity) from safely releasing the active Gemini Live session and microphone resources when the activity is stopped or destroyed. This can lead to background resource leaks and battery drain.

Please retain this function so that the lifecycle owner can properly clean up high-drain resources:

fun stopLiveSession() {
    viewModelScope.launch {
        try {
            session?.stopAudioConversation()
            liveSessionState.update { LiveSessionState.Ready }
            todoRepository.updateMicStatus(micIsOn = false)
        } catch (e: Exception) {
            Log.e(TAG, "Error stopping Live Session onStop: ${e.message}", e)
        }
    }
}

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