How to fullscreen on Android

Currently I have an Android device that has a 1080p ui resolution (desktop is 1080p). When I go into settings and change the display to 4K, the UI resolution stays the same but the display now reports that the HDMI output is 4K instead of 1080p.

Using Android MediaCodec to render, I am able to render onto a 4K Surface when the UI resolution is 1080p.

When I use the same Surface (that was passed to Android MediaCodec) and create ANativeWindow from it

ANativeWindow *new_native_window = ANativeWindow_fromSurface(env, data->surface);

and then I tell glimagesink to render onto it with

gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(data->video_sink),(guintptr) data->native_window);

The resolution is 1080p instead of 4K. How can I get it to render at 4K instead of 1080p?