Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query search against application package name in addition to label. #958

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CepGamer
Copy link
Contributor

When searching apps, compare query against the original app name as well as label to help with i18n. For example, Google suite apps, such as Google Maps, have localised labels in different languages. Google Maps name in Russian is Карты, which cause it to not be shown when querying for map. Current behaviour:

image

Expected behaviour (after this pull request):
image

@@ -222,7 +222,7 @@ internal class AppRepositoryImpl(
appResults.addAll(apps)
} else {
appResults.addAll(apps.filter {
matches(it.label, query)
matches(it.label, query) || matches(it.componentName.packageName.split('.').last(), query)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why only the last part?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of all the com prefixes and company names, e.g. thus any com search queries will break.

I'm thinking about using English (or default) label instead by loading context, what do you think? Although non-English apps may not be indexed, however in that situation it may not be a problem

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package names in general are pretty inconsistent (this is the reason I don't use them already). Loading the English label is certainly the better approach, as long as you cache the English label (just add an internal field to LauncherApp and store it alongside the app)

Copy link
Contributor Author

@CepGamer CepGamer Jul 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for late response, but tinkering around with it it looks like loading Context with different locale config doesn't actually load different labels for apps, since it's being handled by PackageManager.getText which, as I understand, is manufacturer dependent. I'll see if I can retrieve it from adb/manifest somehow, but it looks like package name is the way to go

@jjzhangg
Copy link

jjzhangg commented Aug 3, 2024

Is it possible to make the shortcuts on original desktop searchable and selectable?

@CepGamer
Copy link
Contributor Author

CepGamer commented Aug 3, 2024

Is it possible to make the shortcuts on original desktop searchable and selectable?

AFAIK the new shortcuts should represent 1 to 1 mapping in Kvaesitso launcher. Can you please elaborate and/or provide example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants