Projected context refactor#983
Conversation
…onnection and remove mentions of AI glasses
There was a problem hiding this comment.
Code Review
This pull request updates terminology from 'AI Glasses' to 'Display Glasses' across the project and introduces a new monitorProjectedConnectivity function in ProjectedHardware.kt to better manage device connection states. I agree with the reviewer's suggestion to refactor the startCameraOnGlasses function to utilize this new connectivity monitoring pattern, which will improve robustness by proactively checking for device connectivity rather than relying solely on a try-catch block.
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.
| val projectedContext = try { | ||
| ProjectedContext.createProjectedDeviceContext(activity) | ||
| } catch (e: IllegalStateException) { | ||
| Log.e(TAG, "AI Glasses context could not be created", e) | ||
| Log.e(TAG, "Projected context could not be created", e) | ||
| return | ||
| } |
There was a problem hiding this comment.
This try-catch block for creating the projectedContext is less robust than the new pattern introduced in this PR with monitorProjectedConnectivity. To align with the PR's goal of clarifying connection checking, this function should be updated to proactively check for connectivity using ProjectedContext.isProjectedDeviceConnected before attempting to create the context. This would prevent an IllegalStateException when the device is not connected and make the example code more consistent.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Clarify that you need to check for connection before creating a projected device context. Refactor mentions of AI glasses to audio and display glasses.