Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa06d7e2 authored by Diogo Ferreira's avatar Diogo Ferreira Committed by Martin Brabham
Browse files

fm: Don't crash on rotations when asking for permissions

When asking for permissions, rotating the device would cause the
app to crash because configuration changes try to update a not
yet initialized layout. Fix this by preventing layout updates on
configuration changes if permissions are not yet granted.

Change-Id: I0cdb23df1c07720f70543e7acac5e7b055aa534c
Ticket: CYNGNOS-1678
parent b73f0c1c
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -792,11 +792,13 @@ public class NavigationActivity extends Activity
    @Override
    @Override
    public void onConfigurationChanged(Configuration newConfig) {
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        super.onConfigurationChanged(newConfig);
        if (hasPermissions()) {
            onLayoutChanged();
            onLayoutChanged();
            if (mDrawerToggle != null ) {
            if (mDrawerToggle != null ) {
                mDrawerToggle.onConfigurationChanged(newConfig);
                mDrawerToggle.onConfigurationChanged(newConfig);
            }
            }
        }
        }
    }


    /**
    /**
     * {@inheritDoc}
     * {@inheritDoc}