Android: Detach file descriptor from ParcelFileDescriptor

This fixes a warning in logcat "A resource failed to call close."
This commit is contained in:
Olekoop 2024-07-05 23:38:25 +02:00 committed by Andrew Kaster
parent bbc17c3523
commit 4f05365c4e
Notes: sideshowbarker 2024-07-17 18:06:52 +09:00

View file

@ -35,9 +35,11 @@ class LadybirdServiceConnection(
init.data.putString("PATH", resourceDir)
service!!.send(init)
val parcel = ParcelFileDescriptor.adoptFd(ipcFd)
val msg = Message.obtain(null, MSG_TRANSFER_SOCKET)
msg.data.putParcelable("IPC_SOCKET", ParcelFileDescriptor.adoptFd(ipcFd))
msg.data.putParcelable("IPC_SOCKET", parcel)
service!!.send(msg)
parcel.detachFd()
}
override fun onServiceDisconnected(className: ComponentName) {