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 Change-Id: I85848c2cdf3e151fa94b33dd1dc5c0374ef94b5b Merged-In: Ib2b9690cdd0036b5cc4a1cb846c52bce7c824ab9 Fixes: 79779103
This commit is contained in:
committed by
Andrew Sapperstein
parent
a419c4717d
commit
1dd25fd87c
@@ -23,6 +23,7 @@ import android.os.SystemProperties;
|
||||
import android.support.v14.preference.SwitchPreference;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.support.v7.preference.PreferenceScreen;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.android.internal.telephony.TelephonyIntents;
|
||||
import com.android.internal.telephony.TelephonyProperties;
|
||||
@@ -90,6 +91,11 @@ public class AirplaneModePreferenceController extends TogglePreferenceController
|
||||
&& !context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSliceable() {
|
||||
return TextUtils.equals(getPreferenceKey(), "toggle_airplane");
|
||||
}
|
||||
|
||||
@Override
|
||||
@AvailabilityStatus
|
||||
public int getAvailabilityStatus() {
|
||||
|
Reference in New Issue
Block a user