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:
@@ -28,10 +28,10 @@ import androidx.annotation.VisibleForTesting;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import androidx.preference.TwoStatePreference;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settings.core.TogglePreferenceController;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.search.DatabaseIndexingUtils;
|
||||
import com.android.settings.search.InlineSwitchPayload;
|
||||
@@ -88,6 +88,11 @@ public class BadgingNotificationPreferenceController extends TogglePreferenceCon
|
||||
? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSliceable() {
|
||||
return TextUtils.equals(getPreferenceKey(), "notification_badging");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChecked() {
|
||||
return Settings.Secure.getInt(mContext.getContentResolver(),
|
||||
|
Reference in New Issue
Block a user