mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-21 05:43:37 +00:00
[android-auto] Fix activity recreation when [dis]connecting to car
Signed-off-by: Andrei Shkrob <github@shkrob.dev>
This commit is contained in:
@@ -246,7 +246,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
ManageRouteBottomSheet mManageRouteBottomSheet;
|
||||
|
||||
private boolean mRemoveDisplayListener = true;
|
||||
private int mLastUiMode = Configuration.UI_MODE_TYPE_UNDEFINED;
|
||||
private static int mLastUiMode = Configuration.UI_MODE_TYPE_UNDEFINED;
|
||||
|
||||
public interface LeftAnimationTrackListener
|
||||
{
|
||||
@@ -471,12 +471,10 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
super.onConfigurationChanged(newConfig);
|
||||
|
||||
final int newUiMode = newConfig.uiMode & Configuration.UI_MODE_TYPE_MASK;
|
||||
final boolean newUiModeIsCarConnected = newUiMode == Configuration.UI_MODE_TYPE_CAR;
|
||||
final boolean newUiModeIsCarDisconnected =
|
||||
mLastUiMode == Configuration.UI_MODE_TYPE_CAR && newUiMode == Configuration.UI_MODE_TYPE_NORMAL;
|
||||
final boolean carModeChanged = (newUiMode | mLastUiMode & Configuration.UI_MODE_TYPE_CAR) != 0;
|
||||
mLastUiMode = newUiMode;
|
||||
|
||||
if (newUiModeIsCarConnected || newUiModeIsCarDisconnected)
|
||||
if (carModeChanged)
|
||||
return;
|
||||
|
||||
makeNavigationBarTransparentInLightMode();
|
||||
|
||||
Reference in New Issue
Block a user