[ugc][android] Fixed UGC bugs.

This commit is contained in:
Yuri Gorshenin 2017-06-21 14:59:32 +03:00 committed by Yuri Gorshenin
parent 5a06158a71
commit a291aa1b62
2 changed files with 6 additions and 5 deletions

View file

@ -80,10 +80,10 @@ private:
return;
m_ugcClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/ugc/UGC");
m_ugcCtor = jni::GetConstructorID(
env, m_ratingClass,
env, m_ugcClass,
"([Lcom/mapswithme/maps/ugc/UGC$Rating;F[Lcom/mapswithme/maps/ugc/UGC$Review;)V");
m_onResult =
jni::GetMethodID(env, m_ugcClass, "onUGCReceived", "([Lcom/mapswithme/maps/ugc/UGC;)V");
m_onResult = jni::GetStaticMethodID(env, m_ugcClass, "onUGCReceived",
"(Lcom/mapswithme/maps/ugc/UGC;)V");
m_ratingClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/ugc/UGC$Rating");
m_ratingCtor = jni::GetConstructorID(env, m_ratingClass, "(Ljava/lang/String;F)V");

View file

@ -437,7 +437,9 @@ Framework::Framework(FrameworkParams const & params)
InitCountryInfoGetter();
LOG(LDEBUG, ("Country info getter initialized"));
// To avoid possible races - init search engine in constructor.
InitUGC();
LOG(LDEBUG, ("UGC initialized"));
InitSearchEngine();
LOG(LDEBUG, ("Search engine initialized"));
@ -1457,7 +1459,6 @@ void Framework::InitCountryInfoGetter()
void Framework::InitUGC()
{
ASSERT(!m_ugcApi.get(), ("InitUGC() must be called only once."));
m_ugcApi = make_unique<ugc::Api>(m_model.GetIndex());
}