open-ecosystem-development / OpenXR-SDK

Apache License 2.0
2 stars 3 forks source link

Wolvic 1.1 cannot launch after being forced closed when leaving security zone #41

Open matlu opened 2 years ago

matlu commented 2 years ago

When testing Wolvic 1.1 with Harmony OS 3.0.0.116 cannot launch again after being forced closed when user leaves the security zone. The app will start but cannot reenter VR mode and bring up the launch screen. Just the Wolvic logo is shown for a brief moment and then your back in HVR Launcher. You can try this over and over again but app will not be allowed to launch again. You need to leave VR by disconnecting the VR Glass, close the Apps in the 2D UI and then start over again.

Note even for normal launch as you just have started Huawei VR you may need 1-3 launch attempt before it can start.

lzhangcs commented 2 years ago

The following are some info & log regarding the crash issue that happened when using HarmonyOS 3.0:

The 3dof app and 6dof app crashed 2 times after clicking, and can enter app the third try (Exit and enter again, the crash recurred several times)

image

There are changes for the third party app. to use exact alarm ,need to add permission for this:

https://developer.android.com/about/versions/12/behavior-changes-12#exact-alarm-permission

In general, if app uses setAlarmClock(), setExact(), setExactAndAllowWhileIdle(), Exact Alarm is used. In Android 12, if there is no permission for SCHEDULE_EXACT_ALARM, APP will crash. ( you can test this before you make any code change, if there is no crash before code change, then you should be fine. )

Solution:

  1. Add permission:

image

  1. Return to the authorized UI: The process logic of Google Pixel: Once App is started, it will check the permission; if no SCHEDULE_EXACT_ALARM permission, use toast to remind user to go to permission setting; if user does not enable the setting for alarm clock, there will be issues. (Suggestion is to use popup dialog, if user refuses to enable the permission, exit directly to avoid further problems)

image

svillar commented 2 years ago

We don't use any of the setAlarmClock(), setExact(), setExactAndAllowWhileIdle() directly in Wolvic. It might be however that android code that we call started to use that. We'll add that permission then.

dingsing2021 commented 2 years ago

We don't use any of the setAlarmClock(), setExact(), setExactAndAllowWhileIdle() directly in Wolvic. It might be however that android code that we call started to use that. We'll add that permission then.

Please give us a test apk for this as soon as possible, thanks very much.

lzhangcs commented 2 years ago

New APK with new Kiosk mode API: https://cloud.igalia.com/s/GmMgG2NWkejK7zw

Wolvic is now able to gets its launch parameters from a custom data URI that begins with "wolvic://com.igalia.wolvic", without the need for any extra values.

For example, this URI will open moonrider.xyz in kiosk mode: wolvic://com.igalia.wolvic/?kiosk=true&url=moonrider.xyz

In Java code:

Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData("wolvic://com.igalia.wolvic/\kiosk=true&url=moonrider.x yz" ); context.startActivity(intent);

This functionality can also be tested from the command line:

adb shell am start -a android.intent.action.VIEW -d "wolvic://com.igalia.wolvic/?kiosk=true&url=moonrider.xyz"

Regards

PS: we're sending the 3DoF version as we did previously. We'll generate a 3dof&6dof version once we verify that the SDK fixes allows us to do so.

Lixming commented 2 years ago

"Wolvic 1.1 cannot launch when leaving security zone"--This problem cannot reproduce in our demo with the latest .79 SDK(Test version) . If you still have this problem, please share the log.

svillar commented 2 years ago

Please give us a test apk for this as soon as possible, thanks very much.

We'll send an APK for testing with the AndroidManifest changes. But I insist, we are not directly using those APIs, so there must be a bug somewhere else.

matlu commented 2 years ago

Tested the 3DOF build shared with HOS2 and HOS3 and with SDK 78 and SDK 79 test (https://github.com/hms-ecosystem/OpenXR-SDK/blob/main/demos/HVR_demo/HVRSDK-v79-0923.apk)

Based on my testing there is no issue with relaunching 3DOF version from main launcher under HOS3. However their is a regression with regards to back button and the popup UI to Quit Wolvic. Now when you press Quit nothing will happen. Only way to now exit Wolvic is by using the short press on the Home button on the 3DoF Controller.

This issue cannot be reproduced when using same build under HOS2. In HOS2 the back button and the Quit Wolvic works as expected.

HOS 3 testing 3DOF

@svillar Can you check the issue with my the Exit button no longer work under Android 12. Maybe some new calls are needed?

matlu commented 2 years ago

Tested with latest HOS version 3.0.0.126 and SDK .79 (https://github.com/hms-ecosystem/OpenXR-SDK/blob/main/demos/HVR_demo/HVRSDK-v79-0923.apk) and using the latest 3DOF build that has been updated to support Android 12 AOSP. With this setup the app can successfully be relaunched again after having been forced quit due to leaving safety zone. So with these Android 12 AOSP fixes this issue can be solved.

However the BIG issue with Safety zone blue grid not being shown correctly is still open, and is tracked here: https://github.com/hms-ecosystem/OpenXR-SDK/issues/30