Commit Graph

1603 Commits

Author SHA1 Message Date
Léo Lam 83c5446d85
Fix static initialisation order fiasco issue for Version variables
Fixes a crash that could occur if the static constructor function for
the MainSettings.cpp TU happened to run before the variables in
Common/Version.cpp are initialised. (This is known as the static
initialisation order fiasco.)

By using wrapper functions, those variables are now guaranteed to be
constructed on first use.
2022-01-14 00:04:22 +01:00
Mai M cfb8b9bcf4
Merge pull request #10357 from JosJuice/android-main-debug
Android: Make Main.Debug setting declarations match C++
2022-01-13 07:41:35 -05:00
Mai M 7ebc689b57
Merge pull request #10360 from JosJuice/android-div-6
Android: Don't divide SI device by 6
2022-01-13 07:41:08 -05:00
Pokechu22 161c627466 Treewide: Remove unused inclusions of <cinttypes>
Most of these became unneeded when fmt was introduced.
2022-01-09 12:43:11 -08:00
JosJuice 9f3ed1f9f3 Android: Don't divide SI device by 6
It's a complete coincidence that both SIDEVICE_GC_CONTROLLER (6)
and SIDEVICE_WIIU_ADAPTER (12) are divisible by 6. Dividing
by 6 because of that doesn't make sense, especially not if we
want to add support for more kinds of SI devices on Android later.
2022-01-08 16:06:49 +01:00
Simonx22 0a82bb51bd Android: remove save icon and add up button 2022-01-07 16:23:06 -05:00
JosJuice 13e246a843 Android: Make Main.Debug setting declarations match C++
No functional difference. Just making sure that the settings
have the same name in Java as in C++ so that they're easy to
cross-reference.
2022-01-07 11:25:20 +01:00
Simonx22 ba5c38e3ad Android: update dependencies 2022-01-06 05:55:52 -05:00
Mai M c16b8f4200
Merge pull request #10212 from JosJuice/android-12
Android: Increase targetSdkVersion to 31 (Android 12)
2022-01-06 04:01:00 -05:00
JMC47 500e02dcfb
Merge pull request #10344 from JosJuice/android-no-retain-instance
Android: Remove all setRetainInstance calls
2022-01-04 10:39:22 -05:00
Léo Lam 9a61514073
Merge pull request #10241 from AdmiralCurtiss/user-dir-consistency
Ensure user paths are stored in a consistent manner.
2022-01-01 02:32:24 +01:00
JosJuice 014cc02b96 Android: Fix country constants in CoverHelper.getRegion
This code seems to have been written as if GameFile.getCountry
returns a language rather than a country, which is wrong.
2021-12-28 17:16:49 +01:00
Admiral H. Curtiss ab56f3ecbd
Calls to File::SetUserPath() no longer need to manually append directory separators. 2021-12-25 20:21:32 +01:00
JosJuice 75bf008aba Android: Make WFS directory configurable
The Android version of 5ecd5f0. No scoped storage support, though...
2021-12-24 11:30:09 +01:00
JMC47 820a424dcd
Merge pull request #10272 from JosJuice/android-intent-uri
Android: Rework intent handling to work under scoped storage
2021-12-20 14:30:16 -05:00
JosJuice a8a8b294cd Android: Remove all setRetainInstance calls
Our reasons for using setRetainInstance were gotten rid of in PRs
9011 and 10008, so let's remove our calls to this deprecated method.
2021-12-19 14:45:51 +01:00
Mai M 66fc335c11
Merge pull request #10276 from JosJuice/android-fix-file-manager
Android: Fix opening system file manager
2021-12-15 00:03:16 -05:00
JosJuice 974c7f4f86 Android: Fix opening system file manager
Turns out that most phones ship with a special Google version of
DocumentsUI instead of just using the AOSP version, despite the two
being pretty similar as far as I can tell. This change makes us
check for both package names instead of just the AOSP package name.
2021-12-14 18:34:50 +01:00
JosJuice 41c7e1116a Android: Rework intent handling to work under scoped storage 2021-12-14 18:25:42 +01:00
Admiral H. Curtiss da161faff4
GameList: Show game mod descriptor .json files in game list. 2021-12-12 21:26:09 +01:00
Léo Lam ba62019eb5
Merge pull request #10235 from AdmiralCurtiss/netplay-save-sync-boot
Netplay: Fix possible Wii save restore race condition between Netplay and CPU threads on game shutdown by making the Wii Save Sync data part of the BootParameters.
2021-11-23 16:19:56 +01:00
Mai M 15ff70baba
Merge pull request #10231 from JosJuice/android-dir-init-livedata
Android: Make DirectoryInitialization use LiveData
2021-11-21 21:07:17 -05:00
Admiral H. Curtiss 83ad84061e
Core/Boot: Refactor storage of boot-to-savestate data into a separate class. 2021-11-22 00:35:35 +01:00
Mai M 05ecff199f
Merge pull request #10232 from JosJuice/android-minify
Android: Enable R8 code shrinking
2021-11-21 04:50:03 -05:00
JosJuice 77aa2cd04e Android: Add MMU setting to GUI
Now that we have fast MMU emulation on AArch64, there's no
reason to keep excluding this from the GUI like we've been doing.
2021-11-21 09:38:56 +01:00
JosJuice c2aa2818be Android: Make rescan on app start work again
I haven't fully confirmed why the previous commit broke this,
but I imagine it's due to AfterDirectoryInitializationRunner
executing in a different order than before, resulting in
startRescan running before startLoad.
2021-11-19 22:58:05 +01:00
JosJuice bb475391d2 Android: Make DirectoryInitialization use LiveData
Gets rid of all remaining uses of the deprecated LocalBroadcastManager.
2021-11-19 22:58:05 +01:00
JosJuice d3a23fe5c2 Android: Enable R8 code shrinking
This decreases our APK size by a few megabytes. Most of the reduction
is from Java libraries that we only use small parts of. Code shrinking
gets rid of all the unused code from these libraries from the APK.

Because I highly value the ability to get stack traces that make
sense, I have specifically disabled obfuscation (automatic renaming
of symbols to short incomprehensible names).

I've only enabled code shrinking for release builds, purely because
I feel like the extra build time (30 seconds on my machine)
would be annoying when you want to make debug builds rapidly.
2021-11-19 22:56:34 +01:00
JMC47 6f4bbac528
Merge pull request #9956 from Pokechu22/non-power-of-2-wrap-2
VideoCommon: Manually handle texture wrapping and sampling
2021-11-18 13:08:23 -05:00
Pokechu22 95b9941044 Use Fast Texture Sampling by default
This commit changes the default value of Fast Texture Sampling to true, and also moves the setting that controls it to the experimental section of the advanced tab.  This is its own commit so that it can be easily reverted when we want to default to Manual Texture Sampling.

Co-authored-by: JosJuice <josjuice@gmail.com>
2021-11-17 21:29:57 -08:00
Pokechu22 93eea7cb13 VideoCommon: Add option to use old behavior (Fast Texture Sampling)
Co-authored-by: JosJuice <josjuice@gmail.com>
2021-11-17 21:27:32 -08:00
JosJuice 2941cf8d94 Android: Make GameFileCacheManager use LiveData, part 2
Gets rid some uses of the deprecated LocalBroadcastManager.

One note about the changes in GameFileCacheManager itself:
The change from compareAndSet to getValue followed by
setValue is actually safe, because startLoad and startRescan
only run from the main thread, and only the main thread ever
sets the flags to true. So it's impossible for any other thread
to change the flag in between the getValue and the setValue.
2021-11-17 21:49:51 +01:00
JosJuice 857963b336 Android: Make GameFileCacheManager use LiveData, part 1 2021-11-17 21:29:11 +01:00
Mai M b14d982d36
Merge pull request #10225 from JosJuice/android-game-settings-title
Android: Properly set game settings title when navigating backwards
2021-11-16 23:26:38 -05:00
JosJuice bb2ee279cd Android: Properly set game settings title when navigating backwards 2021-11-16 22:09:40 +01:00
JosJuice ffd8cd059c Android: Make GameFileCacheService not be a service
The past few Android releases have been adding restrictions
to what services are allowed to do, for the sake of stopping
services from using up too much battery in the background.
The IntentService class, which GameFileCacheService uses,
was even deprecated in Android 11 in light of this.

Typically, the reason why you would want use a service instead of
using a simple thread or some other concurrency mechanism from the
Java standard library is if you want to be able to run code in the
background while the user isn't using your app. This isn't actually
something we care about for GameFileCacheService -- if Android wants
to kill Dolphin there's no reason to keep GameFileCacheService
running -- so let's make it not be a service.

I'm changing this mainly for the sake of future proofing, but there
is one immediate (minor) benefit: Previously, if you tried to launch
Dolphin from Android Studio while your phone was locked, the whole
app would fail to launch because launching GameFileCacheService
wasn't allowed because Dolphin wasn't considered a foreground app.
2021-11-16 21:45:06 +01:00
JosJuice 31bfbca923 Android: Split up GameFileCacheService.onHandleIntent 2021-11-16 21:15:49 +01:00
JosJuice 7292ac0ce5 Android: Remove DirectoryInitialization from AndroidManifest.xml
It isn't a service, so it shouldn't be listed as one.
2021-11-15 23:23:17 +01:00
JosJuice 51034ac2dc Android: Increase targetSdkVersion to 31 (Android 12)
Unlike with Android 11, there should be no downsides to doing
this, so we might as well get this out of the way early.
The main part of the work was already done in 5a1a642.
2021-11-14 10:45:15 +01:00
JosJuice 5a23d5cedf Android: Bump NDK and CMake versions
This should make C++20 and std::filesystem work. (Not that
we really can use std::filesystem much on Android since
it doesn't work with scoped storage...)
2021-11-13 20:41:11 +01:00
JosJuice 8b0624f53e Android: Show SD root path in Riivolution activity 2021-10-30 23:24:37 +02:00
JosJuice 22a1f3422c Android: Add Riivolution patch configuration 2021-10-30 23:24:37 +02:00
JosJuice 34021b5ebc Android: Allow starting game with Riivolution patches from the GUI 2021-10-30 23:24:36 +02:00
Léo Lam e4cc1672a2
Merge pull request #10185 from JosJuice/android-fragile
Android: Set android:hasFragileUserData
2021-10-24 22:27:37 +02:00
JosJuice d39150c368 Android: Set android:hasFragileUserData
This makes Android ask the user whether they want to delete user
data when uninstalling the app instead of always deleting user data,
which is pretty great now that we're forced to use scoped storage.
It only works on Android 10 and up, though.
2021-10-24 21:39:09 +02:00
Pokechu22 04d8cdfe88 Convert LOG_TYPE and LOG_LEVELS to enum class 2021-10-24 11:48:36 -07:00
JosJuice ab735293b1 Android: Adjust string about file manager apps on Android 11
When I made 9c8bb24, I assumed it was completely impossible for a
non-preloaded app to access the entirety of the Android/data/ folder
on Android 11. This turned out to be false. While you can't access
the directory without using SAF (even if you have the Manage All
Files permission), and the user can't navigate to the folder using
the SAF folder picker, what you can do is pass the Android/data/
folder as an EXTRA_INITIAL_URI to the SAF folder picker. If the
user then presses "use this folder" without navigating out of the
folder, the app will be able to access the folder using SAF.

So what does that mean for Dolphin? It means scoped storage is a
little less bad than I feared, and I have a string to adjust.
2021-10-20 21:54:22 +02:00
Léo Lam 7855e5f73b
Turn MAX_LOGLEVEL into a true constant (and fix self-comparison warning)
This replaces the MAX_LOGLEVEL define with a constexpr variable
in order to fix self-comparison warnings in the logging macros
when compiling with Clang. (Without this change, the log level check
in the logging macros is expanded into something like this:
`if (LINFO <= LINFO)`, which triggers a tautological compare warning.)
2021-10-15 21:51:01 +02:00
JosJuice 6caf51f966
Merge pull request #9696 from JosJuice/android-scoped-storage
Android: Scoped storage [To be merged in October]
2021-10-15 18:17:16 +02:00
JosJuice b28e5149a7 Android: Improve OpenModeToAndroid's handling of 'b'
Now it also works when b isn't at the very end. (+ goes after b.)
2021-10-13 17:39:09 +02:00