Merge "Fix flickers on the Location page" into tm-dev

This commit is contained in:
TreeHugger Robot
2022-03-30 09:17:53 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 3 deletions

View File

@@ -131,12 +131,16 @@ public class RecentLocationAccessPreferenceController extends LocationBasePrefer
banner.setSelectable(false);
mCategoryRecentLocationRequests.addPreference(banner);
}
if (mUiBlockListener != null) {
mUiBlockListener.onBlockerWorkFinished(this);
}
}
@Override
public void onLocationModeChanged(int mode, boolean restricted) {
boolean enabled = mLocationEnabler.isEnabled(mode);
mCategoryRecentLocationRequests.setVisible(enabled);
updatePreferenceVisibilityDelegate(mCategoryRecentLocationRequests, enabled);
}
/**

View File

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