-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat(deps): Update Android SDK Version to 34 #6
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
575702f
feat(deps): Update Android SDK Version to 34
trindadedev13 9ce1220
Merge branch 'WSTxda:main' into patch-1
trindadedev13 004b2b5
Merge branch 'WSTxda:main' into patch-1
trindadedev13 0287c9b
fix github conflicts.
trindadedev13 cdc46d6
Merge branch 'main' into patch-1
trindadedev13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 21 additions & 5 deletions
26
app/src/main/java/com/wstxda/gsl/MusicSearchQuickSettings.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,34 @@ | ||
package com.wstxda.gsl | ||
|
||
import android.annotation.SuppressLint | ||
import android.app.PendingIntent | ||
import android.content.Intent | ||
import android.os.Build | ||
import android.service.quicksettings.TileService | ||
|
||
@Suppress("DEPRECATION") | ||
class MusicSearchQuickSettings : TileService() { | ||
@SuppressLint("StartActivityAndCollapseDeprecated") | ||
override fun onClick() { | ||
super.onClick() | ||
startActivityAndCollapse( | ||
Intent("com.google.android.googlequicksearchbox.MUSIC_SEARCH").setFlags( | ||
Intent.FLAG_ACTIVITY_NEW_TASK | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { | ||
/* use PendingIntent for the SDK and above */ | ||
val pendingIntent = PendingIntent.getActivity( | ||
this, | ||
0, | ||
Intent("com.google.android.googlequicksearchbox.MUSIC_SEARCH").apply { | ||
flags = Intent.FLAG_ACTIVITY_NEW_TASK | ||
}, | ||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE | ||
) | ||
) | ||
pendingIntent.send() | ||
} else { | ||
/* use normal Intent for the SDK 33 and lower */ | ||
startActivityAndCollapse( | ||
Intent("com.google.android.googlequicksearchbox.MUSIC_SEARCH").apply { | ||
flags = Intent.FLAG_ACTIVITY_NEW_TASK | ||
} | ||
) | ||
} | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is correct, although it cannot collapse system qs panel, apparently this behavior is now managed by the activity being opened or by the system itself. you could probably try some workarounds but honestly I feel like it's not worth it.
I was able to try the changes and the activity is also not invoked on HyperOS A14 for some reason (stupid probably)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, unfortunately I don't have Android 14 to test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code=START_ABORTED
apparently the system is blocking launch of the intent for security policy reason.BAL_BLOCK
suggests that the action was blocked by Activity Management, which reinforces that somehow opening the intent is outside of security08-25 01:15:03.157 1062 2196 I ActivityTaskManager: START u0 {act=com.google.android.googlequicksearchbox.MUSIC_SEARCH flg=0x10000000 cmp=com.google.android.googlequicksearchbox/.MusicSearchGatewayInternal} with LAUNCH_MULTIPLE from uid 10031 pid -1 (BAL_BLOCK) result code=START_ABORTED
Maybe that's why it doesn't initialize, maybe exploiting an internal API is the solution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I just don't understand one thing, in SDK 34, what happens, what would this collapse be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We currently use
StartActivityAndCollapse
to get the behavior of, when tapping, launch the intent and close the system quick settings panel. This is required to display the search and display the results in the browser.Without this behavior the entire process above is done without closing the panel.
As of sdk 34 this is no longer allowed, and apparently there are security restrictions. For this reason i kept the project with sdk 33.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aaa, so when the tile is clicked the panel is not closed, now I understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, and open intent is blocked for security reason