Commit Graph

1588 Commits

Author SHA1 Message Date
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
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 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
JosJuice 800bed330a Android: Add the advanced graphics settings to the GUI 2021-10-04 23:19:14 +02:00
JosJuice 9bb85ca706 DolphinQt/Android: Add warning when converting NKit files
Yes, that's right! It's time to add even more NKit warnings,
because users still don't understand what NKit is or how it works!

More specifically, some users seem to be under the impression that
converting an NKit file to for instance RVZ using Dolphin's convert
feature will result in a normal RVZ file, when it in fact results in
an NKit RVZ file (since NKit is not a container format in the sense
that GCZ/WIA/RVZ/WBFS/CISO is, but rather a kind of trimmed ISO).
I can hardly blame users for not knowing this, because it's not
intuitive unless you know the technical details of how NKit works.
2021-10-02 11:09:36 +02:00
JosJuice 53d7d595e6 Android: Remove the EmulationState class
The purpose of this class was to keep track of state which the
emulation core was already keeping track of. This is rather risky -
if we update the state of one of the two without updating the other,
the two become out of sync, leading to some rather confusing problems.

This duplicated state was removed from EmulationState in the
previous commits, so now there isn't much left in the class.
Might as well move its members directly into EmulationFragment.
2021-09-21 16:34:00 +02:00
JosJuice 2cd09b8eb3 Android: Remove synchronized keywords from EmulationState
These methods are only being called from the GUI thread anyway...
2021-09-21 16:33:59 +02:00
JosJuice 3eb07e9772 Android: Don't rely on onPause for pausing before destroying surface
Fixes a crash which was uncovered (or just made more likely?)
by the previous commit.
2021-09-21 16:33:57 +02:00
JosJuice 446e2d9119 Android: Remove state from EmulationState 2021-09-21 16:32:47 +02:00
JosJuice 2c564a0b9d Android: Remove mSurface from EmulationState 2021-09-21 16:31:55 +02:00
JosJuice a3ce8d61fd Android: Show confirmation dialog for clearing game settings 2021-09-18 12:35:46 +02:00
JosJuice 4e7aaba77a Android: Add button for opening system file manager
Apparently some phones (at least some from Samsung) don't expose the
system file manager in the system settings despite it being the
only on-device file manager that can open app-specific directories...
2021-09-16 20:12:20 +02:00
JosJuice 9c8bb24293 Android: Add a "user data" screen
To make it clearer for users where Dolphin is storing user data,
now that there's more than one possible place.
2021-09-16 20:12:20 +02:00
JosJuice 258832dad4 Android: Enable backup of external app-specific directory 2021-09-16 20:12:20 +02:00
JosJuice 6119f77626 Android: Increment targetSdkVersion to 30 (Android 11)
This enables scoped storage for new Dolphin installs on Android 11
and up (along with a few other changes in behavior which unlike
scoped storage are uncontroversial). Existing installs are unaffected.

We have to do this in order to be able to release updates on
Google Play from November 2021 and on.
2021-09-16 20:12:20 +02:00
JosJuice 3adb07ac74 Android: Show a dialog for scoped storage incompatible settings
The following settings are currently not SAF compatible,
and might never be due to the performance impact:

Dump Path
Load Path
Resource Pack Path
Wii NAND Root

This commit makes us show a message to the user if they try to
change one of these settings while scoped storage is active.
I don't want to entirely remove the settings from being listed
in the settings activity, because it's important that the user
is able to reset them if they were set to something custom in
a previous version of Dolphin.
2021-09-16 20:12:20 +02:00
JosJuice 820420c5f5 Android: Use app-specific directory as User folder by default
This lets Dolphin function without the user granting access to
external storage. We need this for scoped storage compatibility.

When scoped storage is not active, we still ask for permission to
access external storage the first time the app is started so that
we can use the existing dolphin-emu folder if there is one. But
if it doesn't exist, or the user denies the permission, or scoped
storage is active, the app-specific directory will be used instead.
2021-09-16 20:01:47 +02:00
JosJuice 0ca4c6dbd4 Android: Add save button to cheats activity
By request. Matches the settings activity.
2021-09-16 18:48:40 +02:00