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

Add a switch to control suggested apps showing #3803

Merged
merged 5 commits into from
Dec 1, 2023

Conversation

Goooler
Copy link
Collaborator

@Goooler Goooler commented Nov 30, 2023

Description

Enabled:
image

Disabled:
image

Type of change

❌ General change (non-breaking change that doesn't fit the below categories like copyediting)
❌ Bug fix (non-breaking change which fixes an issue)
✅ New feature (non-breaking change which adds functionality)
❌ Breaking change (fix or feature that would cause existing functionality to not work as expected)

@Goooler
Copy link
Collaborator Author

Goooler commented Nov 30, 2023

Seems recent apps were shown when Recents are enabled, should we check if Recents is available?

@Goooler Goooler changed the title Add an option to control recent apps showing Add a switch to control recent apps showing Nov 30, 2023
@suphon-t
Copy link
Member

There’s already an option for this, at least it was in 12.1.
Home Settings -> App Drawer -> Suggestions -> Suggestions in all apps list

@Goooler
Copy link
Collaborator Author

Goooler commented Nov 30, 2023

Seems not.

image

@MrSluffy
Copy link
Member

We already have option of this
photo_6289731377813371376_y
photo_6289731377813371375_y

@Goooler
Copy link
Collaborator Author

Goooler commented Nov 30, 2023

I know why, I can't see this Suggestions entry although I've granted PACKAGE_USAGE_STATS permission for Lawnchair, and there is no ACTION_CONTENT_SUGGESTIONS_SETTINGS activity on my OS.

2023-12-01 02:34:01.076 18520-18520 AndroidRuntime          app.lawnchair.debug                  E  FATAL EXCEPTION: main (Ask Studio Bot)
Process: app.lawnchair.debug, PID: 18520
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.ACTION_CONTENT_SUGGESTIONS_SETTINGS }

@MrSluffy
Copy link
Member

I know why, I can't see this Suggestions entry although I've granted PACKAGE_USAGE_STATS permission for Lawnchair, and there is no ACTION_CONTENT_SUGGESTIONS_SETTINGS activity on my OS.

2023-12-01 02:34:01.076 18520-18520 AndroidRuntime          app.lawnchair.debug                  E  FATAL EXCEPTION: main (Ask Studio Bot)
Process: app.lawnchair.debug, PID: 18520
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.ACTION_CONTENT_SUGGESTIONS_SETTINGS }

Oh I see, maybe try updating ASI and Google app

@Goooler
Copy link
Collaborator Author

Goooler commented Nov 30, 2023

In this case, can we keep this flag to control the suggestions' visibility, maybe I should merge this option into SuggestionsPreference()?

@MrSluffy
Copy link
Member

In this case, can we keep this flag to control the suggestions' visibility, maybe I should merge this option into SuggestionsPreference()?

Maybe add some check, only show if this occur? android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.ACTION_CONTENT_SUGGESTIONS_SETTINGS }

@Goooler Goooler changed the title Add a switch to control recent apps showing Add a switch to control suggested apps showing Nov 30, 2023
@Goooler
Copy link
Collaborator Author

Goooler commented Nov 30, 2023

This check is enough.

if (usagePerm == PackageManager.PERMISSION_GRANTED &&
context.packageManager.resolveActivity(intent, 0) != null
) {

@MrSluffy
Copy link
Member

This check is enough.

if (usagePerm == PackageManager.PERMISSION_GRANTED &&
context.packageManager.resolveActivity(intent, 0) != null
) {

yeah look great

@@ -23,5 +25,14 @@ fun SuggestionsPreference() {
context.startActivity(intent)
},
)
} else {
// On some devices, the Suggestions activity could not be found or PACKAGE_USAGE_STATS is not granted.
Copy link
Member

Choose a reason for hiding this comment

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

This would be confusing if the user's device doesn't have a suggestions service and this toggle appears. A better way would be to investigate why your device has a suggestion service but not the activity.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I found this issue when I set Lawnchair as the QS provider, even if I fallback to the default QS provider, suggested apps are still showing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We probably merge this first, for the ones who need this. Look back on this later.

lawnchair/res/values/config.xml Outdated Show resolved Hide resolved
@MrSluffy MrSluffy self-requested a review December 1, 2023 06:48
@Goooler Goooler merged commit b7a32a0 into 13-dev Dec 1, 2023
4 checks passed
@Goooler Goooler deleted the add-an-option-to-hide-recent-apps branch December 1, 2023 06:49
validcube pushed a commit to validcube/lawnchair that referenced this pull request Dec 15, 2023
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