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

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

Merge "Corresponding changes for latest libtextclassifier import"

parents 2c83d371 2a3adb7f
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -177,8 +177,7 @@ public final class TextClassifierImpl implements TextClassifier {
                final String localesString = concatenateLocales(request.getDefaultLocales());
                final String detectLanguageTags = detectLanguageTagsFromText(request.getText());
                final ZonedDateTime refTime = ZonedDateTime.now();
                final AnnotatorModel annotatorImpl =
                        getAnnotatorImpl(request.getDefaultLocales());
                final AnnotatorModel annotatorImpl = getAnnotatorImpl(request.getDefaultLocales());
                final int start;
                final int end;
                if (mSettings.isModelDarkLaunchEnabled() && !request.isDarkLaunchAllowed()) {
@@ -417,7 +416,8 @@ public final class TextClassifierImpl implements TextClassifier {
                            nativeConversation,
                            null,
                            mContext,
                            getResourceLocalesString());
                            getResourceLocalesString(),
                            getAnnotatorImpl(LocaleList.getDefault()));
            return createConversationActionResult(request, nativeSuggestions);
        } catch (Throwable t) {
            // Avoid throwing from this method. Log the error.
@@ -583,8 +583,7 @@ public final class TextClassifierImpl implements TextClassifier {
                        new File(bestModel.getPath()), ParcelFileDescriptor.MODE_READ_ONLY);
                try {
                    if (pfd != null) {
                        mActionsImpl = new ActionsSuggestionsModel(
                                pfd.getFd(), getAnnotatorImpl(LocaleList.getDefault()));
                        mActionsImpl = new ActionsSuggestionsModel(pfd.getFd());
                        mActionModelInUse = bestModel;
                    }
                } finally {
+3 −0
Original line number Diff line number Diff line
@@ -215,6 +215,7 @@ public class ActionsSuggestionsHelperTest {
                        ConversationAction.TYPE_OPEN_URL,
                        1.0f,
                        null,
                        null,
                        null
                );

@@ -235,6 +236,7 @@ public class ActionsSuggestionsHelperTest {
                        ConversationAction.TYPE_OPEN_URL,
                        1.0f,
                        null,
                        null,
                        new RemoteActionTemplate[0]
                );

@@ -255,6 +257,7 @@ public class ActionsSuggestionsHelperTest {
                        ConversationAction.TYPE_OPEN_URL,
                        1.0f,
                        null,
                        null,
                        new RemoteActionTemplate[]{
                                new RemoteActionTemplate(
                                        "title",
+2 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ public class LegacyIntentClassificationFactoryTest {
                        null,
                        null,
                        null,
                        null,
                        null);

        List<LabeledIntent> intents = mLegacyIntentClassificationFactory.create(
@@ -96,6 +97,7 @@ public class LegacyIntentClassificationFactoryTest {
                        null,
                        null,
                        null,
                        null,
                        null);

        List<LabeledIntent> intents = mLegacyIntentClassificationFactory.create(
+4 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ public class TemplateClassificationIntentFactoryTest {
                        null,
                        null,
                        null,
                        null,
                        createRemoteActionTemplates());

        List<LabeledIntent> intents =
@@ -119,6 +120,7 @@ public class TemplateClassificationIntentFactoryTest {
                        null,
                        null,
                        null,
                        null,
                        createRemoteActionTemplates());

        List<LabeledIntent> intents =
@@ -153,6 +155,7 @@ public class TemplateClassificationIntentFactoryTest {
                        null,
                        null,
                        null,
                        null,
                        null);

        mTemplateClassificationIntentFactory.create(
@@ -185,6 +188,7 @@ public class TemplateClassificationIntentFactoryTest {
                        null,
                        null,
                        null,
                        null,
                        new RemoteActionTemplate[0]);

        mTemplateClassificationIntentFactory.create(