Unable to disconnect internet in webview context using setconnection

I am trying to disconnect internet after switching to web_view context on the Real device:

((AndroidDriver) driver).setConnection(new ConnectionStateBuilder().withWiFiDisabled().withDataDisabled().build());

With above code in the native_app context am able to disconnect wifi , but after setcontext web_view it is throwing error.

using Appium 1.20.2 and java - client : 7.3.0, platform: Android, Realdevice

WD Proxy] Matched ‘/wd/hub/session/ee71c18d-83d8-4b1c-87a1-f3f251402b2b/network_connection’ to command name ‘setNetworkConnection’ [WD Proxy] Proxying [POST /wd/hub/session/ee71c18d-83d8-4b1c-87a1-f3f251402b2b/network_connection] to [POST http://127.0.0.1:8000/wd/hub/session/d547f1365061b81f2bf08011b02c9cde/network_connection] with body: {“name”:“network_connection”,“parameters”:{“type”:0}} [WD Proxy] Got response with status 500: {“value”:{“error”:“unknown error”,“message”:“unknown error: operation is unsupported on Android\n (Session info: chrome=88.0.4324.93)”,“stacktrace”:“Backtrace:\n\tGetHandleVerifier 0x00B1B963+483]\n\tGetHandleVerifier [0x00B1B941+449]\n\tGetHandleVerifier [0x00EC3308+3832712]\n\tGetHandleVerifier [0x00EAEA1E+3748510]\n\tGetHandleVerifier [0x00F016DB+4087643]\n\tGetHandleVerifier [0x00EFB3D7+4062295]\n\tGetHandleVerifier [0x00EDED14+3945876]\n\tGetHandleVerifier [0x00EDFBCE+3949646]\n\tGetHandleVerifier [0x00EDFB59+3949529]\n\tOrdinal0 [0x00ADB5CC+46540]\n\tOrdinal0 [0x00AD9F53+40787]\n\tOrdinal0 [0x00AD9B12+39698]\n\tGetHandleVerifier [0x00DE1468+2907368]\n\tGetHandleVerifier [0x00C271EE+1096302]\n\tGetHandleVerifier [0x00BE3E8D+821005]\n\tGetHandleVerifier [0x00BE396B+819691]\n\tGetHandleVerifier [0x00BE3881+819457]\n\tGetHandleVerifier [0x00C0F463+998627]\n\tBaseThreadInitThunk [0x761EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77367A4E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77367A1E+238]\n”}} [W3C] Matched W3C error code ‘unknown error’ to UnknownError [HTTP] <-- POST /wd/hub/session/ee71c18d-83d8-4b1c-87a1-f3f251402b2b/network_connection 500 9 ms - 1107 [HTTP]