Android пытается получить местоположение только через 90 секунд - PullRequest
0 голосов
/ 21 февраля 2019

У меня есть некоторые проблемы с GPS / Location на пользовательском устройстве Android, которое мы разрабатываем.Обычно GPS работает довольно быстро, но при первом запросе местоположения после загрузки требуется около 90 секунд, чтобы исправить ситуацию.Сначала я подумал, что это проблема с AGPS, однако кажется, что он работает правильно.

Вот выдержка из logcat.Я запускаю приложение, которое запрашивает GPS в 15:37:02.Ничего особенного не происходит, и почти ровно через 90 секунд я начинаю проявлять активностьполучить время через NTP, а затем пытается сделать AGPS, и в течение нескольких секунд я получаю исправление.Обратите внимание, что в настоящее время в этом устройстве не установлена ​​SIM-карта.У кого-нибудь есть идея, что может вызвать такое поведение?Я предполагаю, что причина, по которой Android ждет, состоит в том, что он сначала будет пытаться использовать другие источники местоположения перед GPS в целях экономии энергии, однако это меня не волнует, поскольку устройство не работает от батареи.

# logcat | grep -Ei '(gps|locatio)'
...
02-21 15:36:49.362  2555  4381 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.chartcross.gpstest/.GPSTest (has extras)} from uid 10009 on display 0
02-21 15:36:49.436  2555  2763 I ActivityManager: Start proc 5898:com.chartcross.gpstest/u0a27 for activity com.chartcross.gpstest/.GPSTest
...
02-21 15:37:00.806  4736  5100 I GCoreUlr: Starting service, intent=Intent { act=com.google.android.location.reporting.ACTION_UPDATE_WORLD cmp=com.google.android.gms/com.google.android.location.reporting.service.DispatchingService (has extras) }, extras=Bundle[{receiverAction=init, is_boot=true}]
02-21 15:37:00.976  4736  5126 I GCoreUlr: WorldUpdater received intent Intent { act=com.google.android.location.reporting.ACTION_UPDATE_WORLD cmp=com.google.android.gms/com.google.android.location.reporting.service.DispatchingService (has extras) } with receiverAction com.google.android.location.internal.server.ACTION_RESTARTED
02-21 15:37:01.260  4736  5126 I GCoreUlr: WorldUpdater:com.google.android.location.internal.server.ACTION_RESTARTED: Ensuring that reporting is stopped because of reasons: (no Google accounts)
02-21 15:37:01.904  4736  5126 I GCoreUlr: WorldUpdater received intent Intent { act=com.google.android.location.reporting.ACTION_UPDATE_WORLD cmp=com.google.android.gms/com.google.android.location.reporting.service.DispatchingService (has extras) } with receiverAction init
02-21 15:37:02.661  2555  4381 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.chartcross.gpstest/.GPSTest (has extras)} from uid 10009 on display 0
02-21 15:37:02.714  2555  6671 I ActivityManager: Start proc 7164:com.chartcross.gpstest/u0a27 for activity com.chartcross.gpstest/.GPSTest
...
02-21 15:38:32.349  2555  2838 D GpsLocationProvider: received SIM related action:
02-21 15:38:32.356  2555  2838 D GpsLocationProvider: SIM MCC/MNC is still not available
02-21 15:38:32.356  2555  2838 D GpsLocationProvider: received SIM related action:
02-21 15:38:32.361  2555  2838 D GpsLocationProvider: SIM MCC/MNC is still not available
02-21 15:38:32.689  2555  2838 D GpsLocationProvider: receive broadcast intent, action: android.intent.action.SIM_STATE_CHANGED
02-21 15:38:32.689  2555  2838 D GpsLocationProvider: received SIM related action:
02-21 15:38:32.698  2555  2838 D GpsLocationProvider: SIM MCC/MNC is still not available
02-21 15:38:32.699  2555  2838 D GpsLocationProvider: receive broadcast intent, action: android.intent.action.SIM_STATE_CHANGED
02-21 15:38:32.699  2555  2838 D GpsLocationProvider: received SIM related action:
02-21 15:38:32.704  2555  2838 D GpsLocationProvider: SIM MCC/MNC is still not available
02-21 15:38:32.704  2555  2838 D GpsLocationProvider: received SIM related action:
02-21 15:38:32.709  2555  2838 D GpsLocationProvider: SIM MCC/MNC is still not available
02-21 15:38:35.207  2555  2838 D GpsLocationProvider: setRequest ProviderRequest[ON interval=0]
02-21 15:38:35.214  2555  2838 D GpsLocationProvider: startNavigating, singleShot is false
02-21 15:38:35.214  2555  2838 D GpsLocationProvider: setting position_mode to standalone
02-21 15:38:35.214  2555  2838 V GpsLocationProvider: reportStatus status: 1
02-21 15:38:35.215  2555  2838 D GpsLocationProvider: setRequest ProviderRequest[OFF]
02-21 15:38:35.216  2555  2838 D GpsLocationProvider: stopNavigating
02-21 15:38:35.216  2555  2838 V GpsLocationProvider: reportStatus status: 2
02-21 15:38:35.218  2555  2838 D GpsLocationProvider: receive broadcast intent, action: android.net.conn.CONNECTIVITY_CHANGE
02-21 15:38:35.223  2555  2838 D GpsLocationProvider: setRequest ProviderRequest[ON interval=0]
02-21 15:38:35.223  2555  2838 D GpsLocationProvider: startNavigating, singleShot is false
02-21 15:38:35.223  2555  2838 D GpsLocationProvider: setting position_mode to standalone
02-21 15:38:35.223  2555  2838 V GpsLocationProvider: reportStatus status: 1
02-21 15:38:35.237  2555  4243 D MARTIAN_ANDROID: 142.496 ZS location_cb
02-21 15:38:35.238  2555  4243 V GpsLocationProvider: reportLocation lat: XXXXXX long: XXXXXX timestamp: 1550759917000
02-21 15:38:35.238  2555  4243 D GpsLocationProvider: TTFF: 14
...