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

Commit 7da9111a authored by Nate Myren's avatar Nate Myren
Browse files

Ensure Navigation graph is reset properly

Ensure that the Navigation Graph is set after an instance state is
saved. We cannot rely entirely on the default savedInstanceState to
fully restore the graph.

Test: Navigate to a screen in the Permission Controller, switch to
another user, then switch back. You should remain on the same screen.
Fixes: 147814065

Change-Id: I5cf2fa5584e1cf6e1704616895721af411d873f8
parent a656aa0e
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -66,8 +66,10 @@ public final class ManagePermissionsActivity extends FragmentActivity {
        }
        super.onCreate(savedInstanceState);

        // If there is a previous instance, re-use its Fragment instead of making a new one.
        if (savedInstanceState != null) {
        // If this is not a phone (which uses the Navigation component), and there is a previous
        // instance, re-use its Fragment instead of making a new one.
        if ((DeviceUtils.isTelevision(this) || DeviceUtils.isAuto(this)
                || DeviceUtils.isWear(this)) && savedInstanceState != null) {
            return;
        }

+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ import com.android.permissioncontroller.permission.utils.Utils;
 */
public final class ManageStandardPermissionsFragment extends ManagePermissionsFragment {
    private static final String EXTRA_PREFS_KEY = "extra_prefs_key";
    private static final String LOG_TAG = "ManageStandardPermissionsFragment";
    private static final String LOG_TAG = ManageStandardPermissionsFragment.class.getSimpleName();

    private ManageStandardPermissionsViewModel mViewModel;