Merge "Fix sub status of LocationSettings" into tm-dev

This commit is contained in:
TreeHugger Robot
2022-04-18 04:20:09 +00:00
committed by Android (Google) Code Review
2 changed files with 4 additions and 12 deletions

View File

@@ -28,7 +28,6 @@ import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceScreen; import androidx.preference.PreferenceScreen;
import com.android.settings.R; import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.dashboard.DashboardFragment; import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.dashboard.profileselector.ProfileSelectFragment; import com.android.settings.dashboard.profileselector.ProfileSelectFragment;
import com.android.settingslib.applications.RecentAppOpsAccess; import com.android.settingslib.applications.RecentAppOpsAccess;
@@ -41,8 +40,7 @@ import java.util.List;
/** /**
* Preference controller that handles the display of apps that access locations. * Preference controller that handles the display of apps that access locations.
*/ */
public class RecentLocationAccessPreferenceController extends LocationBasePreferenceController public class RecentLocationAccessPreferenceController extends LocationBasePreferenceController {
implements BasePreferenceController.UiBlocker {
public static final int MAX_APPS = 3; public static final int MAX_APPS = 3;
@VisibleForTesting @VisibleForTesting
RecentAppOpsAccess mRecentLocationApps; RecentAppOpsAccess mRecentLocationApps;
@@ -131,16 +129,12 @@ public class RecentLocationAccessPreferenceController extends LocationBasePrefer
banner.setSelectable(false); banner.setSelectable(false);
mCategoryRecentLocationRequests.addPreference(banner); mCategoryRecentLocationRequests.addPreference(banner);
} }
if (mUiBlockListener != null) {
mUiBlockListener.onBlockerWorkFinished(this);
}
} }
@Override @Override
public void onLocationModeChanged(int mode, boolean restricted) { public void onLocationModeChanged(int mode, boolean restricted) {
boolean enabled = mLocationEnabler.isEnabled(mode); boolean enabled = mLocationEnabler.isEnabled(mode);
updatePreferenceVisibilityDelegate(mCategoryRecentLocationRequests, enabled); mCategoryRecentLocationRequests.setVisible(enabled);
} }
/** /**

View File

@@ -20,13 +20,11 @@ import android.content.Context;
import androidx.preference.Preference; import androidx.preference.Preference;
import androidx.preference.PreferenceScreen; import androidx.preference.PreferenceScreen;
import com.android.settings.core.BasePreferenceController;
/** /**
* Preference controller that handles the "See All" button for recent location access. * Preference controller that handles the "See All" button for recent location access.
*/ */
public class RecentLocationAccessSeeAllButtonPreferenceController extends public class RecentLocationAccessSeeAllButtonPreferenceController extends
LocationBasePreferenceController implements BasePreferenceController.UiBlocker { LocationBasePreferenceController {
private Preference mPreference; private Preference mPreference;
@@ -46,6 +44,6 @@ public class RecentLocationAccessSeeAllButtonPreferenceController extends
@Override @Override
public void onLocationModeChanged(int mode, boolean restricted) { public void onLocationModeChanged(int mode, boolean restricted) {
boolean enabled = mLocationEnabler.isEnabled(mode); boolean enabled = mLocationEnabler.isEnabled(mode);
updatePreferenceVisibilityDelegate(mPreference, enabled); mPreference.setVisible(enabled);
} }
} }