Disable 3D buildings for Android Auto

Signed-off-by: matheusgomesms <matheusgomesms@noreply.codeberg.org>
This commit is contained in:
matheusgomesms
2025-12-11 09:54:34 -03:00
committed by Matheus Gomes
parent 83fee01229
commit 9fc4848905
3 changed files with 10 additions and 0 deletions

View File

@@ -114,6 +114,7 @@ public final class CarAppSession extends Session implements DefaultLifecycleObse
public void onCreate(@NonNull LifecycleOwner owner) public void onCreate(@NonNull LifecycleOwner owner)
{ {
Logger.d(TAG); Logger.d(TAG);
Framework.nativeSetCarScreenMode(true);
mSensorsManager = new CarSensorsManager(getCarContext()); mSensorsManager = new CarSensorsManager(getCarContext());
mDisplayManager = MwmApplication.from(getCarContext()).getDisplayManager(); mDisplayManager = MwmApplication.from(getCarContext()).getDisplayManager();
mDisplayManager.addListener(DisplayType.Car, this); mDisplayManager.addListener(DisplayType.Car, this);
@@ -159,6 +160,7 @@ public final class CarAppSession extends Session implements DefaultLifecycleObse
public void onDestroy(@NonNull LifecycleOwner owner) public void onDestroy(@NonNull LifecycleOwner owner)
{ {
mDisplayManager.removeListener(DisplayType.Car); mDisplayManager.removeListener(DisplayType.Car);
Framework.nativeSetCarScreenMode(false);
} }
private void init() private void init()

View File

@@ -1490,6 +1490,12 @@ JNIEXPORT void JNICALL Java_app_organicmaps_sdk_Framework_nativeSet3dMode(JNIEnv
g_framework->Set3dMode(allow3d, allow3dBuildings); g_framework->Set3dMode(allow3d, allow3dBuildings);
} }
JNIEXPORT void JNICALL Java_app_organicmaps_sdk_Framework_nativeSetCarScreenMode(JNIEnv * env, jclass, jboolean enabled)
{
if (g_framework)
g_framework->SetCarScreenMode(static_cast<bool>(enabled));
}
JNIEXPORT void JNICALL Java_app_organicmaps_sdk_Framework_nativeGet3dMode(JNIEnv * env, jclass, jobject result) JNIEXPORT void JNICALL Java_app_organicmaps_sdk_Framework_nativeGet3dMode(JNIEnv * env, jclass, jobject result)
{ {
bool enabled; bool enabled;

View File

@@ -276,6 +276,8 @@ public class Framework
public static native void nativeSet3dMode(boolean allow3d, boolean allow3dBuildings); public static native void nativeSet3dMode(boolean allow3d, boolean allow3dBuildings);
public static native void nativeSetCarScreenMode(boolean enabled);
public static native boolean nativeGetAutoZoomEnabled(); public static native boolean nativeGetAutoZoomEnabled();
public static native void nativeSetAutoZoomEnabled(boolean enabled); public static native void nativeSetAutoZoomEnabled(boolean enabled);