porting from android4.2.2 source code