Workaround Motorola ril.so incompatiblity with Netlink changes
To workaround a binary incompatiblity with Motorola's ril.so, I had to temporarily provide the old constructor for NetlinkListener as well as a new contructor that takes an additional format argument. There's still a slight chance of a problem because the size of the NetlinkListener has changed with the addition of the mFormat member, but so far I've not seen any obvious problem with that incompatiblity. Another way we could have worked around the incompatiblity is to have netd (the main user of the new format argument to NetlinkListener) keep track of the format itself in it's NetlinkHandler (derived from NetlinkListener) and supply it's own version of onDataAvailable() that's almost 100% identical to NetlinkListener's except for the decode() call. That would allow us not to modify NetlinkListener at all. Worth considering but I think it's more properly divided right now and we just have to make Motorola fix their code (and ideally not use our private APIs). This change should be reverted when Motorola's has fixed their ril to either not use our private APIs or to use our updated ones. Change-Id: I255cca6908444e56cbbbed7eef1fa0cf1d8f0918 Signed-off-by: Mike J. Chen <mjchen@google.com>
This commit is contained in:
parent
17260b1468
commit
2a56688da9
|
@ -28,7 +28,16 @@ public:
|
|||
static const int NETLINK_FORMAT_ASCII = 0;
|
||||
static const int NETLINK_FORMAT_BINARY = 1;
|
||||
|
||||
#if 1
|
||||
/* temporary version until we can get Motorola to update their
|
||||
* ril.so. Their prebuilt ril.so is using this private class
|
||||
* so changing the NetlinkListener() constructor breaks their ril.
|
||||
*/
|
||||
NetlinkListener(int socket);
|
||||
NetlinkListener(int socket, int format);
|
||||
#else
|
||||
NetlinkListener(int socket, int format = NETLINK_FORMAT_ASCII);
|
||||
#endif
|
||||
virtual ~NetlinkListener() {}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -26,6 +26,17 @@
|
|||
|
||||
#include <sysutils/NetlinkEvent.h>
|
||||
|
||||
#if 1
|
||||
/* temporary version until we can get Motorola to update their
|
||||
* ril.so. Their prebuilt ril.so is using this private class
|
||||
* so changing the NetlinkListener() constructor breaks their ril.
|
||||
*/
|
||||
NetlinkListener::NetlinkListener(int socket) :
|
||||
SocketListener(socket, false) {
|
||||
mFormat = NETLINK_FORMAT_ASCII;
|
||||
}
|
||||
#endif
|
||||
|
||||
NetlinkListener::NetlinkListener(int socket, int format) :
|
||||
SocketListener(socket, false), mFormat(format) {
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue