Merge "Make the fragment title can’t searchable"
This commit is contained in:
@@ -31,7 +31,7 @@ public class AutoclickPreferenceController extends BasePreferenceController {
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,8 +31,7 @@ public class TopLevelAccessibilityPreferenceController extends BasePreferenceCon
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return mContext.getResources().getBoolean(R.bool.config_show_top_level_accessibility)
|
||||
? AVAILABLE_UNSEARCHABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class TopLevelAccountEntryPreferenceController extends BasePreferenceCont
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -63,7 +63,7 @@ public class SpecialAppAccessPreferenceController extends BasePreferenceControll
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,7 +31,6 @@ public class DataSaverController extends BasePreferenceController {
|
||||
@AvailabilityStatus
|
||||
public int getAvailabilityStatus() {
|
||||
return mContext.getResources().getBoolean(R.bool.config_show_data_saver)
|
||||
? AVAILABLE_UNSEARCHABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,9 +31,7 @@ public class NotificationAccessController extends BasePreferenceController {
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return !ActivityManager.isLowRamDeviceStatic()
|
||||
? AVAILABLE_UNSEARCHABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
return !ActivityManager.isLowRamDeviceStatic() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
public static boolean hasAccess(Context context, ComponentName cn) {
|
||||
|
||||
@@ -32,7 +32,6 @@ public class PictureInPictureController extends BasePreferenceController {
|
||||
public int getAvailabilityStatus() {
|
||||
return !ActivityManager.isLowRamDeviceStatic()
|
||||
&& mContext.getPackageManager().hasSystemFeature(
|
||||
PackageManager.FEATURE_PICTURE_IN_PICTURE) ? AVAILABLE_UNSEARCHABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
PackageManager.FEATURE_PICTURE_IN_PICTURE) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ public class PremiumSmsController extends BasePreferenceController {
|
||||
@AvailabilityStatus
|
||||
public int getAvailabilityStatus() {
|
||||
return mContext.getResources().getBoolean(R.bool.config_show_premium_sms)
|
||||
? AVAILABLE_UNSEARCHABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,8 +34,6 @@ public class EnabledVrListenersController extends BasePreferenceController {
|
||||
@AvailabilityStatus
|
||||
public int getAvailabilityStatus() {
|
||||
return mContext.getResources().getBoolean(R.bool.config_show_enabled_vr_listeners)
|
||||
&& !mActivityManager.isLowRamDevice()
|
||||
? AVAILABLE_UNSEARCHABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
&& !mActivityManager.isLowRamDevice() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,9 +49,7 @@ public class ZenAccessController extends BasePreferenceController {
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return isSupported(mActivityManager)
|
||||
? AVAILABLE_UNSEARCHABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
return isSupported(mActivityManager) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
public static boolean isSupported(ActivityManager activityManager) {
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
package com.android.settings.connecteddevice;
|
||||
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.bluetooth.BluetoothManager;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -25,19 +23,14 @@ import com.android.settings.R;
|
||||
import com.android.settings.SettingsActivity;
|
||||
import com.android.settings.bluetooth.BluetoothDeviceRenamePreferenceController;
|
||||
import com.android.settings.bluetooth.BluetoothSwitchPreferenceController;
|
||||
import com.android.settings.core.TogglePreferenceController;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settings.widget.SwitchBar;
|
||||
import com.android.settings.widget.SwitchBarController;
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
import com.android.settingslib.search.SearchIndexableRaw;
|
||||
import com.android.settingslib.widget.FooterPreference;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Dedicated screen for allowing the user to toggle bluetooth which displays relevant information to
|
||||
* the user based on related settings such as bluetooth scanning.
|
||||
@@ -47,7 +40,6 @@ public class BluetoothDashboardFragment extends DashboardFragment {
|
||||
|
||||
private static final String TAG = "BluetoothDashboardFrag";
|
||||
private static final String KEY_BLUETOOTH_SCREEN_FOOTER = "bluetooth_screen_footer";
|
||||
public static final String KEY_BLUETOOTH_SCREEN = "bluetooth_switchbar_screen";
|
||||
|
||||
private FooterPreference mFooterPreference;
|
||||
private SwitchBar mSwitchBar;
|
||||
@@ -102,39 +94,5 @@ public class BluetoothDashboardFragment extends DashboardFragment {
|
||||
* For Search.
|
||||
*/
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider() {
|
||||
@Override
|
||||
public List<SearchIndexableRaw> getRawDataToIndex(Context context,
|
||||
boolean enabled) {
|
||||
final List<SearchIndexableRaw> result = new ArrayList<>();
|
||||
|
||||
// Add the activity title
|
||||
final SearchIndexableRaw data = new SearchIndexableRaw(context);
|
||||
data.title = context.getString(R.string.bluetooth_settings_title);
|
||||
data.screenTitle = context.getString(R.string.bluetooth_settings_title);
|
||||
data.keywords = context.getString(R.string.keywords_bluetooth_settings);
|
||||
data.key = KEY_BLUETOOTH_SCREEN;
|
||||
result.add(data);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getNonIndexableKeys(Context context) {
|
||||
final List<String> keys = super.getNonIndexableKeys(context);
|
||||
BluetoothManager manager =
|
||||
(BluetoothManager) context.getSystemService(Context.BLUETOOTH_SERVICE);
|
||||
if (manager != null) {
|
||||
BluetoothAdapter adapter = manager.getAdapter();
|
||||
final int status = adapter != null
|
||||
? TogglePreferenceController.AVAILABLE
|
||||
: TogglePreferenceController.UNSUPPORTED_ON_DEVICE;
|
||||
if (status != TogglePreferenceController.AVAILABLE) {
|
||||
keys.add(KEY_BLUETOOTH_SCREEN);
|
||||
}
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
};
|
||||
new BaseSearchIndexProvider(R.xml.bluetooth_screen);
|
||||
}
|
||||
|
||||
@@ -17,17 +17,12 @@ package com.android.settings.connecteddevice;
|
||||
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.search.SearchIndexableRaw;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This fragment contains previously connected device
|
||||
*/
|
||||
@@ -67,22 +62,5 @@ public class PreviouslyConnectedDeviceDashboardFragment extends DashboardFragmen
|
||||
* For Search.
|
||||
*/
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider() {
|
||||
@Override
|
||||
public List<SearchIndexableRaw> getRawDataToIndex(
|
||||
Context context, boolean enabled) {
|
||||
final List<SearchIndexableRaw> result = new ArrayList<SearchIndexableRaw>();
|
||||
final Resources res = context.getResources();
|
||||
|
||||
// Add fragment title
|
||||
SearchIndexableRaw data = new SearchIndexableRaw(context);
|
||||
data.key = KEY_PREVIOUSLY_CONNECTED_DEVICES;
|
||||
data.title = res.getString(
|
||||
R.string.connected_device_previously_connected_title);
|
||||
data.screenTitle = res.getString(
|
||||
R.string.connected_device_previously_connected_title);
|
||||
result.add(data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
new BaseSearchIndexProvider(R.xml.previously_connected_devices);
|
||||
}
|
||||
@@ -31,8 +31,7 @@ public class TopLevelConnectedDevicesPreferenceController extends BasePreference
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return mContext.getResources().getBoolean(R.bool.config_show_top_level_connected_devices)
|
||||
? AVAILABLE_UNSEARCHABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -44,7 +44,7 @@ public class HardwareInfoPreferenceController extends BasePreferenceController {
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return mContext.getResources().getBoolean(R.bool.config_show_device_model)
|
||||
? AVAILABLE_UNSEARCHABLE : UNSUPPORTED_ON_DEVICE;
|
||||
? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -50,13 +50,13 @@ import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.core.SubSettingLauncher;
|
||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.search.Indexable;
|
||||
import com.android.settingslib.search.SearchIndexableRaw;
|
||||
import com.android.settingslib.RestrictedLockUtils;
|
||||
import com.android.settingslib.RestrictedLockUtilsInternal;
|
||||
import com.android.settingslib.deviceinfo.PrivateStorageInfo;
|
||||
import com.android.settingslib.deviceinfo.StorageManagerVolumeProvider;
|
||||
import com.android.settingslib.search.Indexable;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
import com.android.settingslib.search.SearchIndexableRaw;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -550,13 +550,6 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index
|
||||
final List<SearchIndexableRaw> result = new ArrayList<>();
|
||||
|
||||
SearchIndexableRaw data = new SearchIndexableRaw(context);
|
||||
data.title = context.getString(R.string.storage_settings);
|
||||
data.key = "storage_settings";
|
||||
data.screenTitle = context.getString(R.string.storage_settings);
|
||||
data.keywords = context.getString(R.string.keywords_storage_settings);
|
||||
result.add(data);
|
||||
|
||||
data = new SearchIndexableRaw(context);
|
||||
data.title = context.getString(R.string.internal_storage);
|
||||
data.key = "storage_settings_internal_storage";
|
||||
data.screenTitle = context.getString(R.string.storage_settings);
|
||||
|
||||
@@ -43,7 +43,7 @@ public class TopLevelStoragePreferenceController extends BasePreferenceControlle
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,7 +29,7 @@ public class FirmwareVersionPreferenceController extends BasePreferenceControlle
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,7 +34,7 @@ public class ColorModePreferenceController extends BasePreferenceController {
|
||||
return mContext.getSystemService(ColorDisplayManager.class)
|
||||
.isDeviceColorManaged()
|
||||
&& !ColorDisplayManager.areAccessibilityTransformsEnabled(mContext) ?
|
||||
AVAILABLE_UNSEARCHABLE : DISABLED_FOR_USER;
|
||||
AVAILABLE : DISABLED_FOR_USER;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,7 +28,7 @@ public class FontSizePreferenceController extends BasePreferenceController {
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,21 +20,15 @@ import android.annotation.Nullable;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.view.Display;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.search.Indexable;
|
||||
import com.android.settingslib.search.SearchIndexableRaw;
|
||||
import com.android.settingslib.display.DisplayDensityConfiguration;
|
||||
import com.android.settingslib.display.DisplayDensityUtils;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Preference fragment used to control screen zoom.
|
||||
*/
|
||||
@@ -121,18 +115,8 @@ public class ScreenZoomSettings extends PreviewSeekBarPreferenceFragment {
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider() {
|
||||
@Override
|
||||
public List<SearchIndexableRaw> getRawDataToIndex(Context context,
|
||||
boolean enabled) {
|
||||
final Resources res = context.getResources();
|
||||
final SearchIndexableRaw data = new SearchIndexableRaw(context);
|
||||
data.title = res.getString(R.string.screen_zoom_title);
|
||||
data.key = "screen_zoom_settings";
|
||||
data.screenTitle = res.getString(R.string.screen_zoom_title);
|
||||
data.keywords = res.getString(R.string.screen_zoom_keywords);
|
||||
|
||||
final List<SearchIndexableRaw> result = new ArrayList<>(1);
|
||||
result.add(data);
|
||||
return result;
|
||||
protected boolean isPageSearchEnabled(Context context) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -27,13 +27,8 @@ import android.provider.Settings;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.search.Indexable;
|
||||
import com.android.settingslib.search.SearchIndexableRaw;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Preference fragment used to control font size.
|
||||
*/
|
||||
@@ -118,16 +113,8 @@ public class ToggleFontSizePreferenceFragment extends PreviewSeekBarPreferenceFr
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider() {
|
||||
@Override
|
||||
public List<SearchIndexableRaw> getRawDataToIndex(Context context,
|
||||
boolean enabled) {
|
||||
final ArrayList<SearchIndexableRaw> result = new ArrayList<>();
|
||||
final SearchIndexableRaw data = new SearchIndexableRaw(context);
|
||||
data.title = context.getString(R.string.title_font_size);
|
||||
data.screenTitle = context.getString(R.string.title_font_size);
|
||||
data.key = "font_size_setting_screen";
|
||||
data.keywords = context.getString(R.string.keywords_display_font_size);
|
||||
result.add(data);
|
||||
return result;
|
||||
protected boolean isPageSearchEnabled(Context context) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -43,8 +43,7 @@ public class ManageDeviceAdminPreferenceController extends BasePreferenceControl
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return mContext.getResources().getBoolean(R.bool.config_show_manage_device_admin)
|
||||
? AVAILABLE_UNSEARCHABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -48,8 +48,7 @@ public class TopLevelBatteryPreferenceController extends BasePreferenceControlle
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return mContext.getResources().getBoolean(R.bool.config_show_top_level_battery)
|
||||
? AVAILABLE_UNSEARCHABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,16 +19,12 @@ package com.android.settings.gestures;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.hardware.display.AmbientDisplayConfiguration;
|
||||
import android.provider.SearchIndexableResource;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@SearchIndexable
|
||||
public class GestureSettings extends DashboardFragment {
|
||||
|
||||
@@ -67,20 +63,5 @@ public class GestureSettings extends DashboardFragment {
|
||||
}
|
||||
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider() {
|
||||
@Override
|
||||
public List<SearchIndexableResource> getXmlResourcesToIndex(
|
||||
Context context, boolean enabled) {
|
||||
final SearchIndexableResource sir = new SearchIndexableResource(context);
|
||||
sir.xmlResId = R.xml.gestures;
|
||||
return Arrays.asList(sir);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isPageSearchEnabled(Context context) {
|
||||
// All rows in this screen can lead to a different page, so suppress everything
|
||||
// from this page to remove duplicates.
|
||||
return false;
|
||||
}
|
||||
};
|
||||
new BaseSearchIndexProvider(R.xml.gestures);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class PreventRingingParentPreferenceController extends BasePreferenceCont
|
||||
public int getAvailabilityStatus() {
|
||||
return mContext.getResources().getBoolean(
|
||||
com.android.internal.R.bool.config_volumeHushGestureEnabled)
|
||||
? AVAILABLE_UNSEARCHABLE : UNSUPPORTED_ON_DEVICE;
|
||||
? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -100,12 +100,5 @@ public class TopLevelSettings extends DashboardFragment implements
|
||||
}
|
||||
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.xml.top_level_settings) {
|
||||
|
||||
@Override
|
||||
protected boolean isPageSearchEnabled(Context context) {
|
||||
// Never searchable, all entries in this page are already indexed elsewhere.
|
||||
return false;
|
||||
}
|
||||
};
|
||||
new BaseSearchIndexProvider(R.xml.top_level_settings);
|
||||
}
|
||||
|
||||
@@ -30,10 +30,11 @@ import com.android.settingslib.core.lifecycle.LifecycleObserver;
|
||||
import com.android.settingslib.core.lifecycle.events.OnStart;
|
||||
import com.android.settingslib.inputmethod.InputMethodPreference;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
||||
import java.text.Collator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
||||
public class InputMethodPreferenceController extends BasePreferenceController implements
|
||||
LifecycleObserver, OnStart {
|
||||
@@ -52,7 +53,7 @@ public class InputMethodPreferenceController extends BasePreferenceController im
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,7 +38,6 @@ public class TtsPreferenceController extends BasePreferenceController {
|
||||
public int getAvailabilityStatus() {
|
||||
return !mTtsEngines.getEngines().isEmpty() &&
|
||||
mContext.getResources().getBoolean(R.bool.config_show_tts_settings_summary)
|
||||
? AVAILABLE_UNSEARCHABLE
|
||||
: CONDITIONALLY_UNAVAILABLE;
|
||||
? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class UserDictionaryPreferenceController extends BasePreferenceController
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -46,7 +46,7 @@ public class TopLevelNetworkEntryPreferenceController extends BasePreferenceCont
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return Utils.isDemoUser(mContext) ? UNSUPPORTED_ON_DEVICE : AVAILABLE_UNSEARCHABLE;
|
||||
return Utils.isDemoUser(mContext) ? UNSUPPORTED_ON_DEVICE : AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -32,7 +32,7 @@ public class TopLevelSecurityEntryPreferenceController extends BasePreferenceCon
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -50,7 +50,7 @@ public class LockScreenPreferenceController extends BasePreferenceController imp
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,8 +38,7 @@ public class ResetPreferenceController extends BasePreferenceController {
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return mContext.getResources().getBoolean(R.bool.config_show_reset_dashboard)
|
||||
? AVAILABLE_UNSEARCHABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -69,8 +69,7 @@ public class WifiDisplayPreferenceController extends BasePreferenceController im
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return WifiDisplaySettings.isAvailable(mContext) ? AVAILABLE_UNSEARCHABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
return WifiDisplaySettings.isAvailable(mContext) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,4 +103,4 @@ public class WifiDisplayPreferenceController extends BasePreferenceController im
|
||||
public void onStop() {
|
||||
mRouter.removeCallback(mRouterCallback);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.Network;
|
||||
import android.net.NetworkInfo;
|
||||
@@ -74,7 +73,6 @@ import com.android.settingslib.RestrictedLockUtils;
|
||||
import com.android.settingslib.RestrictedLockUtilsInternal;
|
||||
import com.android.settingslib.search.Indexable;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
import com.android.settingslib.search.SearchIndexableRaw;
|
||||
import com.android.settingslib.wifi.AccessPoint;
|
||||
import com.android.settingslib.wifi.AccessPoint.AccessPointListener;
|
||||
import com.android.settingslib.wifi.AccessPointPreference;
|
||||
@@ -82,7 +80,6 @@ import com.android.settingslib.wifi.WifiSavedConfigUtils;
|
||||
import com.android.settingslib.wifi.WifiTracker;
|
||||
import com.android.settingslib.wifi.WifiTrackerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -194,9 +191,6 @@ public class WifiSettings extends RestrictedSettingsFragment
|
||||
DataUsagePreference mDataUsagePreference;
|
||||
private LinkablePreference mStatusMessagePreference;
|
||||
|
||||
// For Search
|
||||
public static final String DATA_KEY_REFERENCE = "main_toggle_wifi";
|
||||
|
||||
/**
|
||||
* Tracks whether the user initiated a connection via clicking in order to autoscroll to the
|
||||
* network once connected.
|
||||
@@ -1245,24 +1239,6 @@ public class WifiSettings extends RestrictedSettingsFragment
|
||||
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.xml.wifi_settings) {
|
||||
@Override
|
||||
public List<SearchIndexableRaw> getRawDataToIndex(Context context,
|
||||
boolean enabled) {
|
||||
final List<SearchIndexableRaw> result = new ArrayList<>();
|
||||
final Resources res = context.getResources();
|
||||
|
||||
// Add fragment title if we are showing this fragment
|
||||
if (res.getBoolean(R.bool.config_show_wifi_settings)) {
|
||||
SearchIndexableRaw data = new SearchIndexableRaw(context);
|
||||
data.title = res.getString(R.string.wifi_settings);
|
||||
data.screenTitle = res.getString(R.string.wifi_settings);
|
||||
data.keywords = res.getString(R.string.keywords_wifi);
|
||||
data.key = DATA_KEY_REFERENCE;
|
||||
result.add(data);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getNonIndexableKeys(Context context) {
|
||||
final List<String> keys = super.getNonIndexableKeys(context);
|
||||
|
||||
@@ -26,7 +26,6 @@ import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkScoreManager;
|
||||
import android.net.NetworkTemplate;
|
||||
@@ -74,7 +73,6 @@ import com.android.settingslib.RestrictedLockUtils;
|
||||
import com.android.settingslib.RestrictedLockUtilsInternal;
|
||||
import com.android.settingslib.search.Indexable;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
import com.android.settingslib.search.SearchIndexableRaw;
|
||||
import com.android.settingslib.wifi.LongPressWifiEntryPreference;
|
||||
import com.android.wifitrackerlib.WifiEntry;
|
||||
import com.android.wifitrackerlib.WifiEntry.ConnectCallback;
|
||||
@@ -82,7 +80,6 @@ import com.android.wifitrackerlib.WifiPickerTracker;
|
||||
|
||||
import java.time.Clock;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -199,9 +196,6 @@ public class WifiSettings2 extends RestrictedSettingsFragment
|
||||
DataUsagePreference mDataUsagePreference;
|
||||
private LinkablePreference mStatusMessagePreference;
|
||||
|
||||
// For Search
|
||||
public static final String DATA_KEY_REFERENCE = "main_toggle_wifi";
|
||||
|
||||
/**
|
||||
* Tracks whether the user initiated a connection via clicking in order to autoscroll to the
|
||||
* network once connected.
|
||||
@@ -1020,26 +1014,7 @@ public class WifiSettings2 extends RestrictedSettingsFragment
|
||||
};
|
||||
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider() {
|
||||
@Override
|
||||
public List<SearchIndexableRaw> getRawDataToIndex(Context context,
|
||||
boolean enabled) {
|
||||
final List<SearchIndexableRaw> result = new ArrayList<>();
|
||||
final Resources res = context.getResources();
|
||||
|
||||
// Add fragment title if we are showing this fragment
|
||||
if (res.getBoolean(R.bool.config_show_wifi_settings)) {
|
||||
SearchIndexableRaw data = new SearchIndexableRaw(context);
|
||||
data.title = res.getString(R.string.wifi_settings);
|
||||
data.screenTitle = res.getString(R.string.wifi_settings);
|
||||
data.keywords = res.getString(R.string.keywords_wifi);
|
||||
data.key = DATA_KEY_REFERENCE;
|
||||
result.add(data);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
};
|
||||
new BaseSearchIndexProvider(R.xml.wifi_settings2);
|
||||
|
||||
private class WifiEntryConnectCallback implements ConnectCallback {
|
||||
final WifiEntry mConnectWifiEntry;
|
||||
|
||||
Reference in New Issue
Block a user