BinderTransport's TRANSPORT_ATTR_LOCAL_ADDR is different than its peer's TRANSPORT_ATTR_REMOTE_ADDR
- Lenguaje dominante
- Java
- Estrellas
- 12.1k
- Forks
- 4k
- Merge medio
- 2 d 17 h
- PR fusionados (30 d)
- 37
Descripción
Today:
- BinderClientTransport's remote is the AndroidComponentAddress passed to bindService(), which makes sense.
- BinderServerTransport's local is its server's "listening" address, a meaningless concept constructed by calling `AndroidComponentAddress.forContext()` on the Service. This is basically an Intent with a ComponentName but no other fields set. Meaningless, because without considering the onBind() implementation and the setup there's no reason to believe any client could actually bind to such an Intent.
In the other direction
- BinderServerTransport's remote is a `BoundClientAddress` wrapper around the client's uid, which makes sense.
- BinderClientTransport's local is another case of `AndroidComponentAddress.forContext()` called on the client's source Context. This address is meaningless because it can't
This asymmetry is one of the reasons why AbstractTransportTest.socketStats() currently fails.
We could fix this by letting BinderClientTransport's local be a `BoundClientAddress` wrapper around its own UID.
I don't know what to do about BinderServerTransport's local. The client's actual bind Intent *is* mostly available from onBind() but we encourage Services to ignore it and always return the same `BinderServer.getHostBinder()`.
Guía de contribución
Línea de trabajo
Comienza comparando el manejo de direcciones en BinderClientTransport y BinderServerTransport, y luego ejecuta AbstractTransportTest.socketStats() para reproducir la asimetría. Revisa el uso de AndroidComponentAddress y BoundClientAddress, y determina qué direcciones locales y remotas debería informar cada transporte para que las expectativas del test sobre las estadísticas de los sockets sean coherentes.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- android, java
- Área
- mobile-dev, networking
- Tipo de issue
- Error
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 30/100