Godot Android embedding shows black bars in horizontal split screen — how to fully fill the area?

godot 4.3
android sdk 34 arm64-v8
implementation group: ‘org.godotengine’, name: ‘godot’, version: ‘4.3.0.stable’

I’m currently working on integrating my Godot project into an existing Android app using Godot 4.3. My goal is to embed the Godot view on the right half of the screen using a manual horizontal split.

To make sure the rendering fills the available space, I configured my project with the following settings in project.godot:

[display]
window/size/viewport_width = 1920
window/size/viewport_height = 1080
window/stretch/mode = “canvas_items”
window/stretch/aspect = “expand”
On the Android side, I’m embedding the Godot view (GodotFragment) inside a container with MATCH_PARENT layout parameters. At runtime, I manually set its width to 1/2 or 1/3 of the screen, like this:

val layoutParams = FrameLayout.LayoutParams(screenWidth / 2, screenHeight)
godotView.layoutParams = layoutParams
However, when I launch the app, I see black bars on the top and bottom of the Godot view. It seems like the content is not stretching to fill the resized area, even though I use “expand” for stretch/aspect.

What I want is for the Godot scene to fully fill the assigned area with no black borders, regardless of the aspect ratio or how the screen is split.

Has anyone run into this when embedding Godot into Android and doing partial-screen rendering? Is there anything else I need to do to ensure that Godot resizes its viewport properly to match the Android layout?