Remove the Settings search keywords from Slices
The keywords used for settings search are good when we are highly confident the user is searching for as setting (settings search), but not effective in a more general search setting (launcher, an assistant). Thus, we should not index these keywords as Slice keywords, and rely on the setting title and screen title as baseline keywords. Change-Id: I99e44834454b5949c4883f877e02be47498e06e2 Fixes: 78911847 Test: robotests
This commit is contained in:
@@ -30,7 +30,9 @@ import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import androidx.slice.Slice;
|
||||
import androidx.slice.SliceItem;
|
||||
@@ -188,7 +190,10 @@ public class SliceTester {
|
||||
|
||||
private static void assertKeywords(SliceMetadata metadata, SliceData data) {
|
||||
final List<String> keywords = metadata.getSliceKeywords();
|
||||
final List<String> expectedKeywords = Arrays.asList(data.getKeywords().split(","));
|
||||
final Set<String> expectedKeywords = new HashSet<>(
|
||||
Arrays.asList(data.getKeywords().split(",")));
|
||||
expectedKeywords.add(data.getTitle());
|
||||
expectedKeywords.add(data.getScreenTitle().toString());
|
||||
assertThat(keywords).containsExactlyElementsIn(expectedKeywords);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user