The onBack events in these versions are emulated from the OnBackInvokedCallback
So, enable the OnBackAnimationCallback handler as soon as it's available.
Use a stylable value for that and make it depend on API level 34+.
This allows to display the system menu.
It needs Android 14 so we can't set enableOnBackInvokedCallback to true
because we would get an incomplete behaviour on Android 13.
In this case, the feature is only enabled starting with Android 16, so
don't register our handler before.
This should make the code future proof.
With this flag enabled, the KEYCODE_BACK event is never sent through
the onKey callback but using a dedicated callback.
This was previously removed in commit 5cb87c1eca
We removed it when nearing the (then) upcoming 2.7.1 release, Play Store blocked the apk publishing because of this category's inclusion.
At the time, Play Store's error message was:
The app is published as an apk that supports TV. In other words, it contains <category android:name="android.intent.category.LEANBACK_LAUNCHER"/>
under one of the intent-filter of the main activity . It must be published as an app bundle instead.
Which was due to "Following June 30, 2023, Google Play will no longer support TV app updates in APK. All TV app updates must be published with Android App Bundles (AAB)."
Since 2.8.0 we publish to the Play Store in app bundle format, so it should be ok to restore the category. However, this does not necessarily mean
that the app will work on Android / Google TVs without issues. More testing and user feedback might be required.
Some bluetooth keyboards also need "navigation" supported as configuration change
Tested with a new Lamtech bluetooth (BLE5) keyboard and also this is suggested here as well:
https://stackoverflow.com/a/27238892
Since June 30, 2023 Play Store requires TV apps that use this category to use the app bundle distribution model
Since we currently build separate APKs this removal is a temporary measure for the upcoming release of 2.7.1.
However, we should re-instate the tag when we switch to the App Bundle distribution module and perhaps investigate, test
and resolve any other issues related to running the ScummVM Android app for TVs.
And also add some code to load and use the keyCharacterMap of the source device for the event
It is unclear if getUnicodeChar() already does this (loads the keyCharacterMap of the source device.
If it does, then the extra code is redundant.
This makes the icon render much better on Android 11 and Chromebook devices. I
think it should also be backwards compatible - although the oldest device I had
to test was Android 7, it works fine there.
Updated NDK to r21 (LTS)
Switch target Android to 29 as it is required by Google Play Store
Switch minimum Android to 16 (4.1) as it is the lowest supported version by NDK
Removed MIPS and armeabi as they are no longer supported
Renamed Android build names into official ones
Also added macros for the plain (non-SDL) Android port __ANDROID_PLAIN_PORT__ and ANDROID_PLAIN_PORT
The workaround of this commit uses the same logic as for the Nintendo Switch port and should suffice for testing purposes. It should be replaced by more elaborate code of installing and maintaining a certificates pem file.
For an unknown reason, having a second activity for Android TV
(Leanback) caused ScummVM to be broken on some Android devices.
According to Android documentation, TV can be supported in the same
activity as everything else, so merge the two together.
Fixes Trac#10024.
Keep uses-flags at the top to avoid them getting buried below
the activities, update target SDK to the minimum supported by
current Android SDKs, make Wi-Fi optional, and add screenSize
configuration change recommended by the Android documentation since
orientation is already supported.