Added annotations

This commit is contained in:
max-klaus 2021-02-03 14:44:21 +03:00
parent c4448a5dd8
commit 70e8472c6b

View file

@ -24,6 +24,8 @@ import android.view.View;
import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityManager;
import android.widget.Toast; import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.app.AppCompatDelegate;
import androidx.multidex.MultiDex; import androidx.multidex.MultiDex;
@ -910,6 +912,7 @@ public class OsmandApplication extends MultiDexApplication {
return customRoutingConfigs.get(key); return customRoutingConfigs.get(key);
} }
@NonNull
public RoutingConfiguration.Builder getRoutingConfigForMode(ApplicationMode mode) { public RoutingConfiguration.Builder getRoutingConfigForMode(ApplicationMode mode) {
RoutingConfiguration.Builder builder = null; RoutingConfiguration.Builder builder = null;
String routingProfileKey = mode.getRoutingProfile(); String routingProfileKey = mode.getRoutingProfile();
@ -923,11 +926,13 @@ public class OsmandApplication extends MultiDexApplication {
return builder != null ? builder : getDefaultRoutingConfig(); return builder != null ? builder : getDefaultRoutingConfig();
} }
@Nullable
public GeneralRouter getRouter(ApplicationMode mode) { public GeneralRouter getRouter(ApplicationMode mode) {
Builder builder = getRoutingConfigForMode(mode); Builder builder = getRoutingConfigForMode(mode);
return getRouter(builder, mode); return getRouter(builder, mode);
} }
@Nullable
public GeneralRouter getRouter(Builder builder, ApplicationMode am) { public GeneralRouter getRouter(Builder builder, ApplicationMode am) {
GeneralRouter router = builder.getRouter(am.getRoutingProfile()); GeneralRouter router = builder.getRouter(am.getRoutingProfile());
if (router == null && am.getParent() != null) { if (router == null && am.getParent() != null) {