From: Fan Zhang Date: Thu, 10 May 2018 20:53:59 +0000 (-0700) Subject: Add a new enum to support available/non-searchable settings X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=8f699b270dec0340140bfd98b66a9e3596621680;p=android-x86%2Fpackages-apps-Settings.git Add a new enum to support available/non-searchable settings Bug: 72748524 Test: existing robotests Change-Id: I46b2b4a4fa33d8a94de83829cc1eddc99e89b247 --- diff --git a/src/com/android/settings/core/BasePreferenceController.java b/src/com/android/settings/core/BasePreferenceController.java index 830439268d..ec93491759 100644 --- a/src/com/android/settings/core/BasePreferenceController.java +++ b/src/com/android/settings/core/BasePreferenceController.java @@ -30,7 +30,6 @@ import java.lang.reflect.InvocationTargetException; import java.util.List; import androidx.preference.Preference; -import androidx.preference.PreferenceGroup; import androidx.preference.PreferenceScreen; /** @@ -49,22 +48,27 @@ public abstract class BasePreferenceController extends AbstractPreferenceControl * {@link #isSupported()}. */ @Retention(RetentionPolicy.SOURCE) - @IntDef({AVAILABLE, UNSUPPORTED_ON_DEVICE, DISABLED_FOR_USER, DISABLED_DEPENDENT_SETTING, - CONDITIONALLY_UNAVAILABLE}) + @IntDef({AVAILABLE, AVAILABLE_UNSEARCHABLE, UNSUPPORTED_ON_DEVICE, DISABLED_FOR_USER, + DISABLED_DEPENDENT_SETTING, CONDITIONALLY_UNAVAILABLE}) public @interface AvailabilityStatus { } /** - * The setting is available. + * The setting is available, and searchable to all search clients. */ public static final int AVAILABLE = 0; /** + * The setting is available, but is not searchable to any search client. + */ + public static final int AVAILABLE_UNSEARCHABLE = 1; + + /** * A generic catch for settings which are currently unavailable, but may become available in * the future. You should use {@link #DISABLED_FOR_USER} or {@link #DISABLED_DEPENDENT_SETTING} * if they describe the condition more accurately. */ - public static final int CONDITIONALLY_UNAVAILABLE = 1; + public static final int CONDITIONALLY_UNAVAILABLE = 2; /** * The setting is not, and will not supported by this device. @@ -72,7 +76,7 @@ public abstract class BasePreferenceController extends AbstractPreferenceControl * There is no guarantee that the setting page exists, and any links to the Setting should take * you to the home page of Settings. */ - public static final int UNSUPPORTED_ON_DEVICE = 2; + public static final int UNSUPPORTED_ON_DEVICE = 3; /** @@ -81,7 +85,7 @@ public abstract class BasePreferenceController extends AbstractPreferenceControl * Links to the Setting should take you to the page of the Setting, even if it cannot be * changed. */ - public static final int DISABLED_FOR_USER = 3; + public static final int DISABLED_FOR_USER = 4; /** * The setting has a dependency in the Settings App which is currently blocking access. @@ -98,7 +102,7 @@ public abstract class BasePreferenceController extends AbstractPreferenceControl * Links to the Setting should take you to the page of the Setting, even if it cannot be * changed. */ - public static final int DISABLED_DEPENDENT_SETTING = 4; + public static final int DISABLED_DEPENDENT_SETTING = 5; protected final String mPreferenceKey;