forked from organicmaps/organicmaps
[android] Fixed crash in with null framework.
This commit is contained in:
parent
19951c67e8
commit
cb69e41338
1 changed files with 5 additions and 16 deletions
|
@ -210,24 +210,13 @@ public enum LocationHelper
|
|||
{
|
||||
mLogger.d("ctor()");
|
||||
|
||||
// We're trying to catch a nasty bug that (we hope) happen during
|
||||
// LocationHelper construction, when Framework is not initialized
|
||||
// yet. Therefore, this logging is temprorary and must be removed
|
||||
// after investigation.
|
||||
|
||||
Log.i("LocationHelper", "Before nativeSetListener() call");
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
StackTraceElement[] st = Thread.currentThread().getStackTrace();
|
||||
for (StackTraceElement e : st)
|
||||
sb.append(e.toString() + "\n");
|
||||
Log.i("LocationHelper", sb.toString());
|
||||
}
|
||||
|
||||
// TODO consider refactoring.
|
||||
// Actually we shouldn't initialize Framework here,
|
||||
// to allow app components to retrieve location updates without all heavy framework's stuff initialized.
|
||||
// For now this is necessary to connect mModeChangeListener below.
|
||||
MwmApplication.get().initNativeCore();
|
||||
LocationState.nativeSetListener(mModeChangeListener);
|
||||
|
||||
Log.i("LocationHelper", "After nativeSetListener() call");
|
||||
|
||||
calcParams();
|
||||
initProvider(false);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue