Fix Android Build (#2762)
Fixes some mistakes in my playtime tracking for Android PR which caused the build to fail. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2762 Reviewed-by: Maufeat <sahyno1996@gmail.com> Co-authored-by: Inix <Nixy01@proton.me> Co-committed-by: Inix <Nixy01@proton.me>
This commit is contained in:
parent
6bdf479488
commit
cb83a258db
2 changed files with 34 additions and 38 deletions
|
|
@ -203,6 +203,7 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener {
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
stopForegroundService(this)
|
stopForegroundService(this)
|
||||||
|
NativeLibrary.playTimeManagerStop()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -327,11 +328,6 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener {
|
||||||
|
|
||||||
override fun onAccuracyChanged(sensor: Sensor, i: Int) {}
|
override fun onAccuracyChanged(sensor: Sensor, i: Int) {}
|
||||||
|
|
||||||
override fun onDestroy() {
|
|
||||||
super.onDestroy()
|
|
||||||
NativeLibrary.playTimeManagerStop()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun enableFullscreenImmersive() {
|
private fun enableFullscreenImmersive() {
|
||||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -239,6 +239,7 @@ class GamePropertiesFragment : Fragment() {
|
||||||
|
|
||||||
dialog.show()
|
dialog.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun reloadList() {
|
private fun reloadList() {
|
||||||
_binding ?: return
|
_binding ?: return
|
||||||
|
|
||||||
|
|
@ -432,24 +433,25 @@ class GamePropertiesFragment : Fragment() {
|
||||||
SubmenuProperty(
|
SubmenuProperty(
|
||||||
R.string.reset_playtime,
|
R.string.reset_playtime,
|
||||||
R.string.reset_playtime_description,
|
R.string.reset_playtime_description,
|
||||||
R.drawable.ic_delete
|
R.drawable.ic_delete,
|
||||||
) {
|
action = {
|
||||||
MessageDialogFragment.newInstance(
|
MessageDialogFragment.newInstance(
|
||||||
requireActivity(),
|
requireActivity(),
|
||||||
titleId = R.string.reset_playtime,
|
titleId = R.string.reset_playtime,
|
||||||
descriptionId = R.string.reset_playtime_warning_description,
|
descriptionId = R.string.reset_playtime_warning_description,
|
||||||
positiveAction = {
|
positiveAction = {
|
||||||
NativeLibrary.playTimeManagerResetProgramPlayTime( args.game.programId)
|
NativeLibrary.playTimeManagerResetProgramPlayTime(args.game.programId)
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
YuzuApplication.appContext,
|
YuzuApplication.appContext,
|
||||||
R.string.playtime_reset_successfully,
|
R.string.playtime_reset_successfully,
|
||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
getPlayTime()
|
getPlayTime()
|
||||||
homeViewModel.reloadPropertiesList(true)
|
homeViewModel.reloadPropertiesList(true)
|
||||||
}
|
}
|
||||||
).show(parentFragmentManager, MessageDialogFragment.TAG)
|
).show(parentFragmentManager, MessageDialogFragment.TAG)
|
||||||
}
|
}
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -619,19 +621,19 @@ class GamePropertiesFragment : Fragment() {
|
||||||
DirectoryInitialization.userDirectory + "/config/custom/",
|
DirectoryInitialization.userDirectory + "/config/custom/",
|
||||||
destinationFilename = args.game.settingsName + ".ini"
|
destinationFilename = args.game.settingsName + ".ini"
|
||||||
)
|
)
|
||||||
if (iniResult?.exists() == true) {
|
if (iniResult?.exists() == true) {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
requireContext(),
|
requireContext(),
|
||||||
getString(R.string.import_success),
|
getString(R.string.import_success),
|
||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
homeViewModel.reloadPropertiesList(true)
|
homeViewModel.reloadPropertiesList(true)
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
requireContext(),
|
requireContext(),
|
||||||
getString(R.string.import_failed),
|
getString(R.string.import_failed),
|
||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -686,7 +688,5 @@ class GamePropertiesFragment : Fragment() {
|
||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue