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 Change-Id: I85848c2cdf3e151fa94b33dd1dc5c0374ef94b5b Merged-In: Ib2b9690cdd0036b5cc4a1cb846c52bce7c824ab9 Fixes: 79779103
27 lines
680 B
Java
27 lines
680 B
Java
package com.android.settings.testutils;
|
|
|
|
import android.content.Context;
|
|
import android.provider.Settings;
|
|
|
|
import com.android.settings.core.BasePreferenceController;
|
|
|
|
public class FakeUnavailablePreferenceController extends BasePreferenceController {
|
|
|
|
public static final String AVAILABILITY_KEY = "fake_availability_key";
|
|
|
|
public FakeUnavailablePreferenceController(Context context) {
|
|
super(context, "key");
|
|
}
|
|
|
|
@Override
|
|
public int getAvailabilityStatus() {
|
|
return Settings.Global.getInt(mContext.getContentResolver(),
|
|
AVAILABILITY_KEY, 0);
|
|
}
|
|
|
|
@Override
|
|
public boolean isSliceable() {
|
|
return true;
|
|
}
|
|
}
|