Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f049770c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix an issue where the return value is null when retrieving shortcut" into sc-dev

parents 1a742043 b0a39a0b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ public class AppSearchShortcutInfo extends GenericDocument {

    /** The name of the schema type for {@link ShortcutInfo} documents.*/
    public static final String SCHEMA_TYPE = "Shortcut";
    public static final int SCHEMA_VERSION = 1;
    public static final int SCHEMA_VERSION = 2;

    public static final String KEY_ACTIVITY = "activity";
    public static final String KEY_SHORT_LABEL = "shortLabel";
+4 −3
Original line number Diff line number Diff line
@@ -264,7 +264,7 @@ class ShortcutPackage extends ShortcutPackageItem {
    public ShortcutInfo findShortcutById(@Nullable final String id) {
        if (id == null) return null;
        final List<ShortcutInfo> ret = getShortcutById(Collections.singleton(id));
        return ret.isEmpty() ? null : ret.get(0);
        return (ret == null || ret.isEmpty()) ? null : ret.get(0);
    }

    public boolean isShortcutExistsAndInvisibleToPublisher(String id) {
@@ -2361,7 +2361,7 @@ class ShortcutPackage extends ShortcutPackageItem {
        });
    }

    @NonNull
    @Nullable
    private List<ShortcutInfo> getShortcutById(@NonNull final Collection<String> ids) {
        final List<String> shortcutIds = new ArrayList<>(1);
        for (String id : ids) {
@@ -2525,7 +2525,8 @@ class ShortcutPackage extends ShortcutPackageItem {
    private AndroidFuture<AppSearchSession> setupSchema(
            @NonNull final AppSearchSession session) {
        SetSchemaRequest.Builder schemaBuilder = new SetSchemaRequest.Builder()
                .addSchemas(AppSearchPerson.SCHEMA, AppSearchShortcutInfo.SCHEMA);
                .addSchemas(AppSearchPerson.SCHEMA, AppSearchShortcutInfo.SCHEMA)
                .setForceOverride(true);
        for (PackageIdentifier pi : mPackageIdentifiers.values()) {
            schemaBuilder = schemaBuilder
                    .setSchemaTypeVisibilityForPackage(