Merge "Reduce number of wallpaper results in search." into oc-dr1-dev am: 63c63ff640

am: 301dfdd8d1

Change-Id: Iab4d5c24b9ac7cee39af3bcc14631fa09bb455c5
This commit is contained in:
Andrew Sapperstein
2017-06-29 04:52:32 +00:00
committed by android-build-merger
4 changed files with 9 additions and 3 deletions

View File

@@ -127,6 +127,7 @@ public class DisplaySettings extends DashboardFragment {
public List<String> getNonIndexableKeys(Context context) { public List<String> getNonIndexableKeys(Context context) {
List<String> keys = super.getNonIndexableKeys(context); List<String> keys = super.getNonIndexableKeys(context);
keys.add(KEY_DISPLAY_SIZE); keys.add(KEY_DISPLAY_SIZE);
keys.add(WallpaperPreferenceController.KEY_WALLPAPER);
return keys; return keys;
} }

View File

@@ -27,7 +27,7 @@ import static android.os.UserManager.DISALLOW_SET_WALLPAPER;
public class WallpaperPreferenceController extends AbstractPreferenceController implements public class WallpaperPreferenceController extends AbstractPreferenceController implements
PreferenceControllerMixin { PreferenceControllerMixin {
private static final String KEY_WALLPAPER = "wallpaper"; public static final String KEY_WALLPAPER = "wallpaper";
public WallpaperPreferenceController(Context context) { public WallpaperPreferenceController(Context context) {
super(context); super(context);

View File

@@ -45,7 +45,7 @@ public class WallpaperSuggestionActivity extends Activity {
finish(); finish();
} }
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) @VisibleForTesting
void startFallbackSuggestion() { void startFallbackSuggestion() {
// fall back to default wallpaper picker // fall back to default wallpaper picker
Utils.startWithFragment(this, WallpaperTypeSettings.class.getName(), null, null, 0, Utils.startWithFragment(this, WallpaperTypeSettings.class.getName(), null, null, 0,

View File

@@ -90,8 +90,13 @@ public class WallpaperTypeSettings extends SettingsPreferenceFragment implements
final List<ResolveInfo> rList = pm.queryIntentActivities(intent, final List<ResolveInfo> rList = pm.queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY); PackageManager.MATCH_DEFAULT_ONLY);
// Add indexable data for each of the matching activities // Add indexable data for package that is in config_wallpaper_picker_package
final String wallpaperPickerPackage =
context.getString(R.string.config_wallpaper_picker_package);
for (ResolveInfo info : rList) { for (ResolveInfo info : rList) {
if (!wallpaperPickerPackage.equals(info.activityInfo.packageName)) {
continue;
}
CharSequence label = info.loadLabel(pm); CharSequence label = info.loadLabel(pm);
if (label == null) label = info.activityInfo.packageName; if (label == null) label = info.activityInfo.packageName;