Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Add Pause / Unpause Emulation Toggle #8858

Merged
merged 1 commit into from Aug 2, 2020

Conversation

Ebola16
Copy link
Member

@Ebola16 Ebola16 commented Jun 8, 2020

Implements https://bugs.dolphin-emu.org/issues/10602 and should survive orientation changes.

  • Confirm fragment_ingame_menu.xml changes for Android TV work.

Screenshot_20200608-120650_Dolphin Emulator

@Ebola16
Copy link
Member Author

Ebola16 commented Jun 8, 2020

Reminder to update EmulationFragment conditions if #8833 is merged first (or vice versa).

Copy link
Contributor

@sepalani sepalani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested on ASUS RoG Phone II. I don't have an Android TV so I didn't test the leanback part. Otherwise, the pause/play buttons work even after resuming the dolphin app or rotating the screen.

@Ebola16 Ebola16 force-pushed the PUP branch 2 times, most recently from 47880dc to 6e6378d Compare June 16, 2020 20:05
Copy link
Member

@JosJuice JosJuice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM.

@Ebola16
Copy link
Member Author

Ebola16 commented Jun 16, 2020

Something went wrong while testing. Looking into it now.

@Ebola16
Copy link
Member Author

Ebola16 commented Jun 16, 2020

@JosJuice passing activity to EmulationState didn't seem to work after orientation changes and EmulationState has a static inner class so I think it would be best to go with the static variable here. Tested.

Copy link
Member

@JosJuice JosJuice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a little hacking to make my phone run the code paths intended for Android TV, and the code did not work. mPauseEmulationTv and mUnpauseEmulationTv get set to null in onCreateOptionsMenu, so you get a NullPointerException when you try to pause.

I don't believe any MenuFragment has been created at the point onCreateOptionsMenu runs. Perhaps it would be better to put the findViewById calls in MenuFragment.onCreateView. Or maybe you could use the approach I suggested earlier, but only for the Android TV menu.

You can use my branch at https://github.com/JosJuice/dolphin/tree/android-menu-back if you want to test in the way I tested. Make sure to edit the TvUtil.isLeanback checks added in your code.

@Ebola16
Copy link
Member Author

Ebola16 commented Jul 29, 2020

@JosJuice Thanks! That helped and I think I got it working on Android TV but I still can't truly test it since I can't initialize OGL on the Android Emulator. Another check would be appreciated. Marking this as working on Android TV.

@JosJuice JosJuice merged commit bf3d1fa into dolphin-emu:master Aug 2, 2020
10 checks passed
@Ebola16 Ebola16 deleted the PUP branch August 2, 2020 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants