Skip to content

Conversation

@marc-n-dream
Copy link
Collaborator

No description provided.

@marc-n-dream marc-n-dream requested a review from Copilot December 2, 2025 16:29
@marc-n-dream
Copy link
Collaborator Author

@codex review

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades the Android Native integration to version 2.6.2, introducing audio focus management improvements and native game sizing support for Android platforms.

Key changes:

  • Implemented audio focus handling to meet Android Automotive and Android 33+ requirements
  • Added native game sizing configuration support with Android TV workaround
  • Refactored webview lifecycle management to use reload instead of recreation

Reviewed changes

Copilot reviewed 28 out of 35 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
CHANGELOG.md Documents new audio focus improvements and native game sizing support
Assets/WebGLTemplates/AirConsole-U6/airconsole-unity-plugin.js Adds Android TV detection workaround for native game sizing
Assets/WebGLTemplates/AirConsole-2020/airconsole-unity-plugin.js Adds Android TV detection workaround for native game sizing
Assets/AirConsole/unity-webview/Runtime/WebViewObject.cs Implements audio focus callbacks and muting functionality
Assets/Packager/Editor/Packager.cs Removes webview package copying logic from export process
Assets/AirConsole/unity-webview/Editor/UnityWebViewPostprocessBuild.cs Refactors AndroidX dependencies into separate method, adds webkit dependency
Assets/AirConsole/scripts/Runtime/Settings.cs Updates version to 2.6.2
Assets/AirConsole/scripts/Runtime/NativeGameSizingSettings.cs Adds new settings class for native game sizing configuration
Assets/AirConsole/scripts/Runtime/Plugin/Android/PluginManager.cs Adds volume and audio focus event handling
Assets/AirConsole/scripts/Runtime/AirConsole.cs Implements comprehensive audio focus state machine and volume management
Assets/AirConsole/scripts/Editor/BuildAutomation/AndroidGradleProcessor.cs Adds gradle version validation and AndroidX webkit dependency
Assets/AirConsole/examples/basic/basic.unity Updates scene with new AudioManager component
Assets/AirConsole/examples/basic/AudioManager.cs New example demonstrating audio focus handling
Assets/AirConsole/ProjectCodeUpdater.cs Adds structure cleanup logic for legacy installations
AGENTS.md New documentation file describing project structure
.editorconfig Adds comprehensive code formatting rules
Files not reviewed (2)
  • .idea/.idea.airconsole-unity-plugin/.idea/codeStyles/Project.xml: Language not supported
  • .idea/.idea.airconsole-unity-plugin/.idea/codeStyles/codeStyleConfig.xml: Language not supported
Comments suppressed due to low confidence (1)

Assets/AirConsole/scripts/Runtime/AirConsole.cs:1

  • Using Debug.LogWarning instead of AirConsoleLogger which is used throughout the rest of the codebase. Consider using AirConsoleLogger for consistency.
#if !UNITY_EDITOR && UNITY_ANDROID

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@marc-n-dream marc-n-dream force-pushed the marc-android-native-upgrade branch from 1eb4ee0 to 0361877 Compare December 3, 2025 09:11
@marc-n-dream marc-n-dream requested a review from Copilot December 3, 2025 13:33
@marc-n-dream
Copy link
Collaborator Author

@codex review

@marc-n-dream marc-n-dream added this to the v2.6.2 milestone Dec 3, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 28 out of 43 changed files in this pull request and generated 8 comments.

Files not reviewed (2)
  • .idea/.idea.airconsole-unity-plugin/.idea/codeStyles/Project.xml: Language not supported
  • .idea/.idea.airconsole-unity-plugin/.idea/codeStyles/codeStyleConfig.xml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 2451 to 2455
MaximumAudioVolume = Mathf.Clamp01(_canHaveAudioFocus ? newMaximumVolume : 0f);
AirConsoleLogger.LogDevelopment(() =>
$"HandleOnMaxVolumeChanged({newMaximumVolume}) -> {MaximumAudioVolume}. No action taken.");

// eventQueue.Enqueue(() => OnGameAudioFocusChanged?.Invoke(!Mathf.Approximately(MaximumAudioVolume, 0), MaximumAudioVolume));

Choose a reason for hiding this comment

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

P1 Badge Fire audio-focus event on volume updates

Android volume callbacks never reach the game: HandleOnMaxVolumeChanged clamps MaximumAudioVolume when the native plugin reports a volume change but only logs the value, with the OnGameAudioFocusChanged invocation commented out. OnReady now enforces that Android games register this event, yet when the platform sends volume limits (e.g., AudioFocus changes on Automotive devices) listeners are never notified and cannot reduce or mute audio as required.

Useful? React with 👍 / 👎.

@marc-n-dream marc-n-dream force-pushed the marc-android-native-upgrade branch from 6f7837b to 1c532de Compare December 4, 2025 16:25
@marc-n-dream marc-n-dream requested a review from Copilot December 10, 2025 12:29
@marc-n-dream
Copy link
Collaborator Author

@codex review

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 34 out of 51 changed files in this pull request and generated 6 comments.

Files not reviewed (2)
  • .idea/.idea.airconsole-unity-plugin/.idea/codeStyles/Project.xml: Language not supported
  • .idea/.idea.airconsole-unity-plugin/.idea/codeStyles/codeStyleConfig.xml: Language not supported
Comments suppressed due to low confidence (1)

Assets/AirConsole/scripts/Editor/BuildAutomation/AndroidGradleProcessor.cs:97

  • Uses C# 9.0 target-typed new() syntax. Verify that the project's C# language version is set to 9.0 or higher, or use explicit type new List<string>() for compatibility with older versions.
            List<string> lines = new();

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@marc-n-dream marc-n-dream force-pushed the marc-android-native-upgrade branch 2 times, most recently from 448e289 to 73b476f Compare December 10, 2025 12:55
@marc-n-dream marc-n-dream requested a review from Copilot December 10, 2025 13:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 40 out of 57 changed files in this pull request and generated 4 comments.

Files not reviewed (2)
  • .idea/.idea.airconsole-unity-plugin/.idea/codeStyles/Project.xml: Language not supported
  • .idea/.idea.airconsole-unity-plugin/.idea/codeStyles/codeStyleConfig.xml: Language not supported
Comments suppressed due to low confidence (1)

Assets/AirConsole/scripts/Runtime/AirConsole.cs:1

  • Forcing application termination when no listeners are registered is overly aggressive. This creates a hard dependency where Android games must implement audio focus handling or crash. Consider issuing a warning instead, allowing graceful degradation with default behavior (e.g., pausing audio when focus is lost).
#if !UNITY_EDITOR && UNITY_ANDROID

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@marc-n-dream marc-n-dream force-pushed the marc-android-native-upgrade branch from 73b476f to 694e012 Compare December 10, 2025 14:17
@marc-n-dream marc-n-dream force-pushed the marc-android-native-upgrade branch from 694e012 to e4af937 Compare December 10, 2025 14:50
@marc-n-dream marc-n-dream deleted the marc-android-native-upgrade branch December 11, 2025 09:35
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.

2 participants