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

Commit 8f8666e3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Retain and restore showSystem state when rotated" into sc-dev

parents bf0ef5b7 c2ea62d1
Loading
Loading
Loading
Loading
+19 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@
package com.android.settings.location;
package com.android.settings.location;


import android.content.Context;
import android.content.Context;
import android.os.Bundle;
import android.view.Menu;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.MenuItem;
@@ -36,6 +37,7 @@ public class RecentLocationAccessSeeAllFragment extends DashboardFragment {


    private static final int MENU_SHOW_SYSTEM = Menu.FIRST + 1;
    private static final int MENU_SHOW_SYSTEM = Menu.FIRST + 1;
    private static final int MENU_HIDE_SYSTEM = Menu.FIRST + 2;
    private static final int MENU_HIDE_SYSTEM = Menu.FIRST + 2;
    private static final String EXTRA_SHOW_SYSTEM = "show_system";


    private boolean mShowSystem = false;
    private boolean mShowSystem = false;
    private MenuItem mShowSystemMenu;
    private MenuItem mShowSystemMenu;
@@ -59,6 +61,23 @@ public class RecentLocationAccessSeeAllFragment extends DashboardFragment {
        }
        }
    }
    }


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (savedInstanceState != null) {
            mShowSystem = savedInstanceState.getBoolean(EXTRA_SHOW_SYSTEM, mShowSystem);
        }
        if (mController != null) {
            mController.setShowSystem(mShowSystem);
        }
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putBoolean(EXTRA_SHOW_SYSTEM, mShowSystem);
    }

    @Override
    @Override
    protected int getPreferenceScreenResId() {
    protected int getPreferenceScreenResId() {
        return R.xml.location_recent_access_see_all;
        return R.xml.location_recent_access_see_all;