Add isSliceable API to BasePrefController
Only support explicitly approved Settings Slices, dictated by controllers which return true for the new method isSliceable. Updating the supported settings to a whitelist means that the method to return all available slices must be updated, and checking slicability when we index slices. Test: robotests Bug: 79779103 Change-Id: Ib2b9690cdd0036b5cc4a1cb846c52bce7c824ab9
This commit is contained in:
@@ -19,6 +19,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.android.internal.hardware.AmbientDisplayConfiguration;
|
||||
import com.android.settings.R;
|
||||
@@ -54,6 +55,11 @@ public class AmbientDisplayAlwaysOnPreferenceController extends TogglePreference
|
||||
return isAvailable(mConfig) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSliceable() {
|
||||
return TextUtils.equals(getPreferenceKey(), "ambient_display_always_on");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChecked() {
|
||||
return mConfig.alwaysOnEnabled(MY_USER);
|
||||
|
Reference in New Issue
Block a user