clone from https://code.google.com/p/android-ipmsg/ and resolve some bug for the android-16 level.