Prevent an app from going to sleep/crashing when handing off the Immersive device to another user

I have had an issue for a while where we would like to demo an app on the immersive device and would like to start the user already in the app, maybe after some menus have been navigated. However, often the app will just close when I remove the headset and the other user puts it on, or it might be stuck on the black screen which is basically the equivalent of crashing.

How do I prevent this, especially given how inconsistent it is and the same app might perform this handoff behavior just fine in testing but will fail on later attempts? I have looked into a number of solutions including enabling the run in background setting in unity and the extended execution session for uwp, none of which seem to fix the issue.

any help would be appreciated.

Best Answer

Answers

  • In my side, it works well. Could you use a sample in MRTK to reproduce your issue?

  • nyt_Rushnyt_Rush
    edited September 23

    @EricWilson @MRFan Hi, I am new hololens devlopement..even I am trying to run the app in the background...were you able to solve this issue.
    How did you implement extended execution in unity solution even I want to try this approach..could you please guide me about it?

  • Accepted Answer

    @nyt_Rush there is a run in background option in the player settings in unity. if that doesn't work you can take a look at the docs for https://docs.microsoft.com/en-us/windows/uwp/launch-resume/run-minimized-with-extended-execution.

    I was never able to get my desired result through code however. In order to prevent the app from returning to the menu, we blocked the sensor in the headset that determines if a user is wearing the headset. This way, it is not able to exit an app when handoff occurs.

  • nyt_Rushnyt_Rush
    edited September 26

    @EricWilson said:
    @nyt_Rush there is a run in background option in the player settings in unity. if that doesn't work you can take a look at the docs for https://docs.microsoft.com/en-us/windows/uwp/launch-resume/run-minimized-with-extended-execution.

    I was never able to get my desired result through code however. In order to prevent the app from returning to the menu, we blocked the sensor in the headset that determines if a user is wearing the headset. This way, it is not able to exit an app when handoff occurs.

    Hi @EricWilson ,

    Thanks, for the prompt reply, how did you block the sensor is there any internal API built for this sort of behavior?

  • @nyt_Rush Not as far as I know, unfortunately. We went with a simpler option and decided to put a sticky note over the sensor to prevent it from detecting distance.

Sign In or Register to comment.