Commit graph

1565 commits

Author SHA1 Message Date
JosJuice
bb2ee279cd Android: Properly set game settings title when navigating backwards 2021-11-16 22:09:40 +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
JosJuice
ffa25c4cf5 Android: Allow $ line when entering cheat code
Port of cda442d.
2021-09-16 18:48:40 +02:00
JosJuice
53ae1a0725 Android: Add Gecko code downloading 2021-09-16 18:48:39 +02:00
JosJuice
47efd3317d Android: Fix CheatsActivity d-pad navigation
Special shoutout to Android for not having RTL compatible
variants of nextFocusRight and nextFocusLeft.

Ideally we would have some way to block the user from using
the d-pad to switch between the two panes when in portrait mode,
or make the list pane act as if it's to the left of the details
pane rather than the right when the details pane is open, but I
don't know of a good way to do this. SlidingPaneLayout doesn't
really seem to have been implemented with d-pad navigation in mind.
Thankfully, landscape is the most important use case for gamepads.
2021-09-16 18:48:39 +02:00
JosJuice
215492152c Android: Show warning when Enable Cheats is off 2021-09-16 18:48:39 +02:00
JosJuice
1470dfcf81 Android: Add the ability to delete cheats 2021-09-16 18:48:39 +02:00
JosJuice
404eb13e2f Android: Add the ability to add cheats 2021-09-16 18:48:39 +02:00
JosJuice
6934b9a21d Android: Add headers to cheat list 2021-09-16 18:48:38 +02:00
JosJuice
109aef4b81 Android: Scroll to field with error when error occurs 2021-09-16 18:48:38 +02:00
JosJuice
e299be1d85 Android: Add creator and notes fields for Gecko codes 2021-09-16 18:48:38 +02:00
JosJuice
883a9f8a99 Android: Allow viewing/editing the actual codes 2021-09-16 18:48:38 +02:00
JosJuice
fc6c31c3db Android: Update cheat list when a cheat is edited
The way I'm implementing events using LiveData feels rather
unorthodox, but I'm not aware of anything in the Android framework
that would let me do it in a better way... One option I did
consider was wrapping the cheat lists in LiveData and observing
those, but then CheatsAdapter wouldn't know which cheat had
changed, only that there was some kind of change to the list,
necessitating the use of the not recommended notifyDataSetChanged.
2021-09-16 16:46:50 +02:00
JosJuice
43dcbf33ad Android: Add edit button for cheats 2021-09-16 16:46:49 +02:00
JosJuice
a303b4bc98 Android: Programmatically open/close cheat details
Only has an effect when using a narrow screen.
2021-09-16 16:46:49 +02:00
JosJuice
95879c2e76 Android: Add details view for cheats
The details view only contains the name of the cheat for now.
2021-09-16 16:46:49 +02:00
JosJuice
93a1271386 Android: Add checkboxes for toggling cheats enabled 2021-09-16 16:46:49 +02:00
JosJuice
67a8855d9a Android: Add "Enable Cheats" setting to GUI 2021-09-16 16:46:49 +02:00
JosJuice
4d609c769f Android: Implement basic read-only cheats list 2021-09-16 16:46:48 +02:00
JosJuice
ee3a5a4a81 Android: Create CheatsActivity 2021-09-16 16:46:48 +02:00
JosJuice
719930bb39 Android: Add fast path to addOrGet
This path isn't really any faster in the normal case,
but it does let us skip waiting for the lock to be available,
which makes a huge difference if the lock is already taken.
2021-08-24 15:35:40 +02:00
JosJuice
fb265b610d Android: Don't hold gameFileCache lock during updateAdditionalMetadata
It seems like we spend a lot of the game list scanning time in
updateAdditionalMetadata, which I suppose makes sense considering
how many different files that function attempts to open.

With the addition of just one little atomic operation, we can make
it safe to call updateAdditionalMetadata without holding a lock.
2021-08-24 15:35:39 +02:00
JosJuice
bba33c7ced Android: Don't hold gameFileCache lock while finding games
FindAllGamePaths may take a little while, and holding the
gameFileCache lock isn't actually necessary until it's time to
put the results returned by FindAllGamePaths into gameFileCache.

The downside of this change is that we have to do an extra
round of JNI in between FindAllGamePaths and Update,
but I don't think that's much of a problem.
2021-08-24 14:56:33 +02:00
JosJuice
a4e5d233be
Merge pull request #9864 from PEmu2/wiimote
Change "Wiimote" to "Wii Remote" in interface
2021-08-07 12:44:55 +02:00
Simonx22
9a33fd3f7f Android: update dependencies 2021-07-25 16:23:18 -04:00