[android] add: Actual implementation of "Migrate" button.

This commit is contained in:
Alexander Marchuk 2016-01-22 21:36:07 +03:00 committed by Sergey Yershov
parent 9623308839
commit fe873597a4
3 changed files with 15 additions and 7 deletions

View file

@ -146,19 +146,15 @@ extern "C"
GetMapLayout().DownloadMap(storage::ToNative(index), ToOptions(options));
}
// FIXME (trashkalmar): Include proper logic
static bool legacy_mode = true;
JNIEXPORT jboolean JNICALL
Java_com_mapswithme_country_ActiveCountryTree_isLegacyMode(JNIEnv * env, jclass clazz)
{
return legacy_mode;
return g_framework->NeedMigrate();
}
JNIEXPORT void JNICALL
Java_com_mapswithme_country_ActiveCountryTree_migrate(JNIEnv * env, jclass clazz)
{
legacy_mode = false;
g_framework->Migrate();
}
}

View file

@ -542,11 +542,20 @@ void Framework::SetActiveUserMark(UserMark const * mark)
m_activeUserMark = mark;
}
bool Framework::NeedMigrate()
{
return platform::migrate::NeedMigrate();
}
void Framework::Migrate()
{
m_work.Migrate();
}
UserMark const * Framework::GetActiveUserMark()
{
return m_activeUserMark;
}
} // namespace android
//============ GLUE CODE for com.mapswithme.maps.Framework class =============//

View file

@ -169,6 +169,9 @@ namespace android
void SetActiveUserMark(UserMark const * mark);
UserMark const * GetActiveUserMark();
bool NeedMigrate();
void Migrate();
public:
virtual void ItemStatusChanged(int childPosition);
virtual void ItemProgressChanged(int childPosition, storage::LocalAndRemoteSizeT const & sizes);