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

Android: Add isGame application attribute, default to true #50028

Merged
merged 1 commit into from
Jul 1, 2021

Conversation

akien-mga
Copy link
Member

@akien-mga akien-mga commented Jun 30, 2021

It can be turned off in the export preset with package/classify_as_game.

Upstream definition: https://developer.android.com/guide/topics/manifest/application-element#isGame

android:isGame

Whether or not the application is a game. The system may group together
applications classifed as games or display them separately from other
applications.


Supersedes #48547.

needs testing as I haven't tested this code yet, just wrote it by analogy with the allowBackup attribute.

@akien-mga akien-mga added enhancement platform:android needs testing cherrypick:3.x Considered for cherry-picking into a future 3.x release topic:export labels Jun 30, 2021
@akien-mga akien-mga added this to the 4.0 milestone Jun 30, 2021
@akien-mga akien-mga requested a review from a team as a code owner June 30, 2021 16:49
@akien-mga
Copy link
Member Author

Tested with the prebuilt APK workflow and it works fine.

However with custom build, it fails with:

Execution failed for task ':processDebugMainManifest'.
> Manifest merger failed : Attribute application@isGame value=(false) from AndroidManifest.xml:23:9-30
  	is also present at AndroidManifest.xml:23:9-30 value=(true).
  	Suggestion: add 'tools:replace="android:isGame"' to <application> element at AndroidManifest.xml:16:5-25:19 to override.

I see that the tools:replace trick is used for android:screenOrientation in activity, but I'm puzzled that android:allowBackup seems to work fine with the exact same code I'm using here for android:isGame.

@akien-mga
Copy link
Member Author

but I'm puzzled that android:allowBackup seems to work fine with the exact same code I'm using here for android:isGame.

Actually no, it's a pre-existing bug, it's just that nobody ever seems to set allowBackup to true for custom builds :)

Execution failed for task ':processDebugMainManifest'.
> Manifest merger failed : Attribute application@allowBackup value=(true) from AndroidManifest.xml:21:9-36
  	is also present at AndroidManifest.xml:21:9-36 value=(false).
  	Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:16:5-25:19 to override.

It can be turned off in the export preset with `package/classify_as_game`.

Upstream definition: https://developer.android.com/guide/topics/manifest/application-element#isGame

> `android:isGame`
>
> Whether or not the application is a game. The system may group together
> applications classifed as games or display them separately from other
> applications.

Also fixes replacing `android:allowBackup` in custom builds.
@akien-mga
Copy link
Member Author

Fixed the issues with custom builds, and I've tested a number of combinations successfully (prebuilt APK with and without isGame, custom build AAB with and without isGame and allowBackup).

@akien-mga akien-mga merged commit 7ee419f into godotengine:master Jul 1, 2021
@akien-mga akien-mga deleted the android-isGame-attribute branch July 1, 2021 10:02
@akien-mga
Copy link
Member Author

Cherry-picked for 3.4.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jul 5, 2021
akien-mga added a commit to akien-mga/godot that referenced this pull request Jul 6, 2021
… cherry-pick

The `android:icon` attribute is expected to be the last one in the application
definition, as documented by the comment. cd64bcd missed that and caused some
arguments to be truncated.

Fixes godotengine#50224.
akien-mga added a commit that referenced this pull request Jul 6, 2021
Android: Fix truncated `application` attributes after #50028 cherry-pick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants