[Xiaomi Mi A1 Questions & Answers] DenDries:
I've just bought the Mi A1 a few days ago and so far it has been a great device. There is a major issue with Netflix and my Chromecast however.

As soon as I start casting Netflix to my Chromecast and I screen lock the A1, the Chromecast is disconnected after a bit more than one minute. The issue is also triggered when I cast from another device (which is supposed to work fine) but my Mi A1 is also connected to WiFi (and locked) during that time.

I'm on the february security update (but issue was also present with the januari security update). I've also tried setting Netflix to "Non optimized" in the battery settings and "Keep WiFi on during sleep" is set to always. Does anyone experience the same problem?

From the adb logcat it appears that Netflix is disconnected after the A1 loses its connection to WiFi.

03-03 19:21:50.897 1230 16834 E WakeLock: release without a matched acquire!
03-03 19:21:50.899 1215 1521 E CastSocket: [com.netflix.mediaclient] IOException encountered. Tearing down the socket.
03-03 19:21:50.899 1215 1521 E CastSocket: java.io.IOException: Software caused connection abort
03-03 19:21:50.899 1215 1521 E CastSocket:	at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
03-03 19:21:50.899 1215 1521 E CastSocket:	at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
03-03 19:21:50.899 1215 1521 E CastSocket:	at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
03-03 19:21:50.899 1215 1521 E CastSocket:	at sun.nio.ch.IOUtil.read(IOUtil.java:197)
03-03 19:21:50.899 1215 1521 E CastSocket:	at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:419)
03-03 19:21:50.899 1215 1521 E CastSocket:	at lbd.read(Unknown Source:2)
03-03 19:21:50.899 1215 1521 E CastSocket:	at laa.j(com.google.android.gms@12217448@12.2.17 (448-186052348):5)
03-03 19:21:50.899 1215 1521 E CastSocket:	at laj.run(com.google.android.gms@12217448@12.2.17 (448-186052348):44)
03-03 19:21:50.899 1215 1521 E CastSocket:	at java.lang.Thread.run(Thread.java:764)
03-03 19:21:50.899 1230 16834 E GCM : Connection closed with errorCode 20
03-03 19:21:50.900 1215 15784 I CastDeviceController: [controller-0417-com.netflix.mediaclient API] finishDisconnecting; socketError="2 IO Error", mDisconnectStatusCode=SUCCESS
03-03 19:21:50.901 1215 15784 I CastDeviceController: [controller-0417-com.netflix.mediaclient API] listener.onDisconnected(NETWORK_ERROR)
03-03 19:21:50.901 1215 15784 I CastService: [instance-406] onDisconnected: package: com.netflix.mediaclient status=NETWORK_ERROR
03-03 19:21:50.901 2547 4623 D ConnectivityService: reportNetworkConnectivity(186, false) by 10013
03-03 19:21:50.901 2547 16786 I chatty : uid=1000 system_server expire 2 lines
03-03 19:21:50.902 1215 1521 E CastSocket: [gms_cast_mrp] IOException encountered. Tearing down the socket.
03-03 19:21:50.902 1215 1521 E CastSocket: java.io.IOException: Software caused connection abort
03-03 19:21:50.902 1215 1521 E CastSocket:	at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
03-03 19:21:50.902 1215 1521 E CastSocket:	at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
03-03 19:21:50.902 1215 1521 E CastSocket:	at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
03-03 19:21:50.902 1215 1521 E CastSocket:	at sun.nio.ch.IOUtil.read(IOUtil.java:197)
03-03 19:21:50.902 1215 1521 E CastSocket:	at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:419)
03-03 19:21:50.902 1215 1521 E CastSocket:	at lbd.read(Unknown Source:2)
03-03 19:21:50.902 1215 1521 E CastSocket:	at laa.j(com.google.android.gms@12217448@12.2.17 (448-186052348):5)
03-03 19:21:50.902 1215 1521 E CastSocket:	at laj.run(com.google.android.gms@12217448@12.2.17 (448-186052348):44)
03-03 19:21:50.902 1215 1521 E CastSocket:	at java.lang.Thread.run(Thread.java:764)
03-03 19:21:50.903 2030 2234 I Netd : Destroyed 7 sockets on 2a02:1812:1d00:1f00:b81a:b8e0:d8fe:2de5 in 0.7 ms
03-03 19:21:50.903 1230 11526 V NativeCrypto: Read error: ssl=0x795a304d08: I/O error during system call, Software caused connection abort
03-03 19:21:50.904 1230 16834 E WakeLock: release without a matched acquire!
03-03 19:21:50.904 1215 1521 E CastSocket: [com.netflix.mediaclient] IOException encountered. Tearing down the socket.
03-03 19:21:50.904 1215 1521 E CastSocket: java.io.IOException: Software caused connection abort
03-03 19:21:50.904 1215 1521 E CastSocket:	at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
03-03 19:21:50.904 1215 1521 E CastSocket:	at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
03-03 19:21:50.904 1215 1521 E CastSocket:	at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
03-03 19:21:50.904 1215 1521 E CastSocket:	at sun.nio.ch.IOUtil.read(IOUtil.java:197)
03-03 19:21:50.904 1215 1521 E CastSocket:	at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:419)
03-03 19:21:50.904 1215 1521 E CastSocket:	at lbd.read(Unknown Source:2)
03-03 19:21:50.904 1215 1521 E CastSocket:	at laa.j(com.google.android.gms@12217448@12.2.17 (448-186052348):5)
03-03 19:21:50.904 1215 1521 E CastSocket:	at laj.run(com.google.android.gms@12217448@12.2.17 (448-186052348):44)
03-03 19:21:50.904 1215 1521 E CastSocket:	at java.lang.Thread.run(Thread.java:764)
03-03 19:21:50.904 1215 1521 E WakeLock: release without a matched acquire!
03-03 19:21:50.907 2030 2242 D CommandListener: Clearing all IP addresses on wlan0
03-03 19:21:50.908 1215 1709 I CastService: [instance-407] Google Play services client: 11400000, Google Play services APK: 12217000
03-03 19:21:50.908 1215 1709 I CastService: [instance-407] acquireDeviceController by com.netflix.mediaclient
03-03 19:21:50.908 1215 15784 I CastDeviceController: [controller-0415-gms_cast_mrp MRP] finishDisconnecting; socketError="2 IO Error", mDisconnectStatusCode=SUCCESS
03-03 19:21:50.908 1230 13259 V NativeCrypto: Write error: ssl=0x795a304d08: I/O error during system call, Broken pipe
03-03 19:21:50.909 1215 15784 I CastDeviceController: [controller-0415-gms_cast_mrp MRP] listener.onDisconnected(NETWORK_ERROR)

I've also tried disabling battery optimization for the following apps, but it didn't have any effect.

Android Services Library
Android Shared Library
Android System
ANT HAL Service
CarrierDefaultApp
CarrierLoadService
com.qti.qualcomm.datastatusnotification
com.qualcomm.qcrilmsgtunnel
com.qualcomm.qti.networksetting
com.qualcomm.qti.qtisystemservice
com.quicinc.cne.CNEService.CNEServiceApp (probably this one, Qualcomm “Smarts” to 3G/4G Wi-Fi Seamless Interworking)
Google
Google Play Store
Google Services Framework
Home
LocationServices
Netflix
Phone and Messaging Storage
Phone Services
ProxyHandler