-
Notifications
You must be signed in to change notification settings - Fork 19
Upgrade Android Native integration #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@codex review |
There was a problem hiding this 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.
There was a problem hiding this 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".
1eb4ee0 to
0361877
Compare
|
@codex review |
There was a problem hiding this 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.
Assets/AirConsole/scripts/Editor/BuildAutomation/AndroidGradleProcessor.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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".
| MaximumAudioVolume = Mathf.Clamp01(_canHaveAudioFocus ? newMaximumVolume : 0f); | ||
| AirConsoleLogger.LogDevelopment(() => | ||
| $"HandleOnMaxVolumeChanged({newMaximumVolume}) -> {MaximumAudioVolume}. No action taken."); | ||
|
|
||
| // eventQueue.Enqueue(() => OnGameAudioFocusChanged?.Invoke(!Mathf.Approximately(MaximumAudioVolume, 0), MaximumAudioVolume)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 👍 / 👎.
6f7837b to
1c532de
Compare
|
@codex review |
There was a problem hiding this 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 typenew 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.
There was a problem hiding this 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".
448e289 to
73b476f
Compare
There was a problem hiding this 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.
73b476f to
694e012
Compare
Implements related aspects in the native android library and the webview
build: 20251015-1115
…ve for topbar vs fullscreen event flows
694e012 to
e4af937
Compare
No description provided.