android: cosmetic changes
js: add scanFlags as the parameter for scan method

This way the scan options(indicate the supported formats) is better
differentiated from scan flags(indicate different flags).