[android] Fixed isFirstLaunch regression. Follow up c0a7710f48.

Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
Viktor Govako 2023-10-16 22:42:36 -03:00
parent 43444dfc07
commit 21d0d19be2
3 changed files with 6 additions and 5 deletions

View file

@ -455,11 +455,10 @@ public class MwmActivity extends BaseMwmFragmentActivity
this::onPostNotificationPermissionResult);
boolean isConsumed = savedInstanceState == null && processIntent(getIntent());
boolean isFirstLaunch = Config.isFirstStartDialogSeen(this);
// If the map activity is launched by any incoming intent (deeplink, update maps event, etc)
// or it's the first launch (onboarding) we haven't to try restoring the route,
// showing the tips, etc.
if (isConsumed || isFirstLaunch)
if (isConsumed || Config.isFirstLaunch(this))
return;
if (RoutingController.get().isPlanning())

View file

@ -156,7 +156,7 @@ public class SplashActivity extends AppCompatActivity
return;
}
if (Config.isFirstStartDialogSeen(this) && LocationUtils.checkLocationPermission(this))
if (Config.isFirstLaunch(this) && LocationUtils.checkLocationPermission(this))
{
final LocationHelper locationHelper = app.getLocationHelper();
locationHelper.onEnteredIntoFirstRun();
@ -188,11 +188,13 @@ public class SplashActivity extends AppCompatActivity
result.putExtra(EXTRA_INITIAL_INTENT, initialIntent);
if (!initialIntent.hasCategory(Intent.CATEGORY_LAUNCHER))
{
/// @todo Is it ok that we don't call setFirstStartDialogSeen here?
// Wait for the result from MwmActivity for API callers.
mApiRequest.launch(result);
return;
}
}
Config.setFirstStartDialogSeen(this);
startActivity(result);
finish();

View file

@ -358,9 +358,9 @@ public final class Config
editor.apply();
}
public static boolean isFirstStartDialogSeen(@NonNull Context context)
public static boolean isFirstLaunch(@NonNull Context context)
{
return MwmApplication.prefs(context).getBoolean(KEY_MISC_FIRST_START_DIALOG_SEEN, false);
return !MwmApplication.prefs(context).getBoolean(KEY_MISC_FIRST_START_DIALOG_SEEN, false);
}
public static void setFirstStartDialogSeen(@NonNull Context context)