Use searchable="false" to suppress nonIndexables.

When possible, remove or simplify getNonIndexable() logic in fragments,
and use searchable="false" in xml to suppress index.

Change-Id: I5bdf5bc7d5494a64cdd9e230a51321a4b210af69
Fixes: 112608186
Test: robotest and manual search
This commit is contained in:
Fan Zhang
2018-08-15 12:55:56 -07:00
parent 8419e4d127
commit 9ce4a1fcde
45 changed files with 134 additions and 286 deletions

View File

@@ -154,8 +154,6 @@ public class LockscreenDashboardFragment extends DashboardFragment
public List<String> getNonIndexableKeys(Context context) {
final List<String> niks = super.getNonIndexableKeys(context);
niks.add(KEY_ADD_USER_FROM_LOCK_SCREEN);
niks.add(KEY_LOCK_SCREEN_NOTIFICATON_WORK_PROFILE);
niks.add(KEY_LOCK_SCREEN_NOTIFICATON_WORK_PROFILE_HEADER);
return niks;
}

View File

@@ -20,6 +20,8 @@ import android.content.Context;
import android.os.UserHandle;
import android.provider.SearchIndexableResource;
import androidx.fragment.app.Fragment;
import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R;
@@ -34,16 +36,12 @@ import com.android.settingslib.search.SearchIndexable;
import java.util.ArrayList;
import java.util.List;
import androidx.fragment.app.Fragment;
@SearchIndexable
public class ScreenLockSettings extends DashboardFragment
implements OwnerInfoPreferenceController.OwnerInfoCallback {
private static final String TAG = "ScreenLockSettings";
private static final String KEY_LOCK_SCREEN_TITLE = "security_settings_password_sub_screen";
private static final int MY_USER_ID = UserHandle.myUserId();
private LockPatternUtils mLockPatternUtils;
@@ -107,12 +105,5 @@ public class ScreenLockSettings extends DashboardFragment
return buildPreferenceControllers(context, null /* parent */,
null /* lifecycle */, new LockPatternUtils(context));
}
@Override
public List<String> getNonIndexableKeys(Context context) {
final List<String> keys = super.getNonIndexableKeys(context);
keys.add(KEY_LOCK_SCREEN_TITLE);
return keys;
}
};
}