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

Commit ed548430 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix an issue where the return value is null when retrieving shortcut"...

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14173062

Change-Id: I21a3606f0b7ca5063abe97f78481a9d152482ee9
parents 254df1fb f049770c
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(