2

We are attempting a Server communication with "HttpsURLConnection" object, where we have set the "connection" property of the request Object to "close" [setRequestProperty("Connection", "close")]. The above setting was working fine until in Android 9 OS in all devices, where as in some of the devices with Android 10 OS(Eg: Samsung A70 with Android 10) we are encountering an "java.net.ConnectException". When we remove our Connection property, the server communication got established and resolved the issue. I need your support in understanding the root-cause why there is a behavioral change in Android 10 OS and is there any impact by removing the connection object

url = new URL(reqURL);
httpsConnection = url.openConnection();
httpsConnection.setRequestMethod("POST");
httpsConnection.setRequestProperty("Content-Language", "en");
httpsConnection.setRequestProperty("Connection", "close");
httpsConnection.setRequestProperty("Content-Type","application/text");
OutputStream os = httpsConnection.getOutputStream();
os.write(cvmesgToServer.getBytes()) httpsConnection.connect();
hata
  • 11,633
  • 6
  • 46
  • 69
John Ruban Singh
  • 1,284
  • 14
  • 19

1 Answers1

2

You need to set timeout - Samsung update is bugged as hell

https://www.softax.pl/blog/solved-samsung-a70-problems-after-upgrade-to-android-10-do-i-have-to-wait-for-samsung-to-help-my-app-users/

exxone
  • 21
  • 1