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

feat(deps): Update Android SDK Version to 34 #6

Closed
wants to merge 5 commits into from
Closed

feat(deps): Update Android SDK Version to 34 #6

wants to merge 5 commits into from

Conversation

trindadedev13
Copy link

@trindadedev13 trindadedev13 commented Aug 23, 2024

As you know, this PR is not ready, because TileService#startActivityAndCollapse is deprecated in SDK 34 and above.

@WSTxda
Copy link
Owner

WSTxda commented Aug 24, 2024

In api 34 StartActivityAndCollapse in MusicSearchQuickSettings is deprecated, need create another method to collapse qs painel after lauch intent.

@trindadedev13
Copy link
Author

In api 34 StartActivityAndCollapse in MusicSearchQuickSettings is deprecated, need create another method to collapse qs painel after lauch intent.

okay, I'll take a look later then

@trindadedev13 trindadedev13 marked this pull request as draft August 25, 2024 02:18
@trindadedev13 trindadedev13 marked this pull request as ready for review August 25, 2024 03:15
@trindadedev13
Copy link
Author

@WSTxda please re-view PR

Comment on lines +14 to 23
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
)
Copy link
Owner

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)

Copy link
Author

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)

Hmm, unfortunately I don't have Android 14 to test.

Copy link
Owner

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 security

08-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?

Copy link
Author

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?

Copy link
Owner

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.

Copy link
Author

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.

Copy link
Owner

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

@WSTxda
Copy link
Owner

WSTxda commented Aug 26, 2024

Ok, i made the decision to just update the java, then keep the sdk target to 33, due this reason #6 (comment)

@trindadedev13 trindadedev13 changed the title feat: update java to 18, update targetSDK to 34 feat: Update SDK to 34(wip) Aug 26, 2024
@trindadedev13 trindadedev13 changed the title feat: Update SDK to 34(wip) feat: update java to 18, update targetSDK to 34 Aug 26, 2024
@trindadedev13 trindadedev13 changed the title feat: update java to 18, update targetSDK to 34 feat(deps): Update Android SDK Version to 34 (WIP) Aug 26, 2024
@trindadedev13 trindadedev13 marked this pull request as draft August 26, 2024 18:38
@trindadedev13
Copy link
Author

Ok, i made the decision to just update the java, then keep the sdk target to 33, due this reason #6 (comment)

OK, I won't close the PR, but I'll mark it as a draft. When I have time, I'll study it to see something that can replace this call without the depreciation, of course, that is, if you don't find it first.

@WSTxda WSTxda added the TODO Future or ongoing changes label Aug 26, 2024
@trindadedev13 trindadedev13 changed the title feat(deps): Update Android SDK Version to 34 (WIP) feat(deps): Update Android SDK Version to 34 **WIP** Aug 26, 2024
@trindadedev13 trindadedev13 changed the title feat(deps): Update Android SDK Version to 34 **WIP** feat(deps): Update Android SDK Version to 34 ***WIP*** Aug 26, 2024
@trindadedev13 trindadedev13 changed the title feat(deps): Update Android SDK Version to 34 ***WIP*** feat(deps): Update Android SDK Version to 34 Aug 26, 2024
@WSTxda WSTxda marked this pull request as ready for review September 14, 2024 01:18
@WSTxda WSTxda marked this pull request as draft September 14, 2024 01:20
@trindadedev13 trindadedev13 closed this by deleting the head repository Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TODO Future or ongoing changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants