/
githubmirror
/
omim
Обзор
Документация
Войти
/
githubmirror
/
omim
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
android/src/com/mapswithme/maps/location/GPSCheck.java
30 строк
986 B
Alexey Osminin
[android] remove MwmApplication.get part 3
07 дек 2020, 12:43
07 дек 2020, 12:43
2bb578b
Код
Авторство
О чём код?
package com.mapswithme.maps.location; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import com.mapswithme.maps.MwmApplication; import com.mapswithme.util.log.Logger; import com.mapswithme.util.log.LoggerFactory; import static com.mapswithme.maps.MwmApplication.backgroundTracker; public class GPSCheck extends BroadcastReceiver { private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.LOCATION); private static final String TAG = GPSCheck.class.getSimpleName(); @Override public void onReceive(Context context, Intent intent) { String msg = "onReceive: " + intent + " app in background = " + !backgroundTracker(context).isForeground(); LOGGER.i(TAG, msg); if (MwmApplication.from(context).arePlatformAndCoreInitialized() && MwmApplication.backgroundTracker(context).isForeground()) { LocationHelper.INSTANCE.restart(); } } }