Fix the Night Light page UI shrinking
- This problem causes the TwilightLocationPreferenceController too late to decide the preference display or not. - Move the display criteria into the getAvailabilityStatus Fixes: 159032276 Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.display Test: manual review Change-Id: I5850479e8a891f837c0e6772ad1096e702f95e34
This commit is contained in:
@@ -21,7 +21,6 @@ import android.content.Intent;
|
||||
import android.location.LocationManager;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.R;
|
||||
@@ -57,13 +56,9 @@ public class TwilightLocationPreferenceController extends BasePreferenceControll
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
preference.setVisible(!mLocationManager.isLocationEnabled());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
return mLocationManager.isLocationEnabled() ? CONDITIONALLY_UNAVAILABLE
|
||||
: AVAILABLE_UNSEARCHABLE;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user