add support for new foreground API

https://groups.google.com/d/msg/osmand/mUcvDVMLsMI/c3_mgBG_kRwJ