Merge "Retain and restore showSystem state when rotated" into sc-dev am: 8f8666e3d0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14356126 Change-Id: Iaf005289258cae91eb7dda45cc478141a7af7abf
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
package com.android.settings.location;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
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_HIDE_SYSTEM = Menu.FIRST + 2;
|
||||
private static final String EXTRA_SHOW_SYSTEM = "show_system";
|
||||
|
||||
private boolean mShowSystem = false;
|
||||
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
|
||||
protected int getPreferenceScreenResId() {
|
||||
return R.xml.location_recent_access_see_all;
|
||||
|
Reference in New Issue
Block a user