cancel
Showing results for 
Search instead for 
Did you mean: 

MediaProjection breaks input & hand tracking by triggering FocusPlaceholderActivity (v76)

M-LINESTUDIO
Honored Guest
Device: Meta Quest 2 / Meta Quest 3  
OS Version: v76
 
We are using Android MediaProjection API for screen mirroring in our contents.
 
problem 1.
After starting MediaProjection for screen mirroring in a normal Android activity, the system spawned :
[com.oculus.vrshell.FocusPlaceholderActivity]
 
This does not happen every time. 
But when it does, the `FocusPlaceholderActivity` takes over the input system, causing the original activity to lose input focus. 
After that, hand tracking completely breaks.
 
Captured Log in Runtime:
05-14 17:14:42.990  3151  3151 I wm_on_create_called: [com.oculus.vrshell.FocusPlaceholderActivity, performCreate]  
05-14 17:14:42.991  3151  3151 I wm_on_start_called: [com.oculus.vrshell.FocusPlaceholderActivity, handleStartActivity]
 
Shortly after, hand tracking remapping fails:
05-14 17:14:42.992  6519  6537 W MemoryBrokerClient: Hands: failed to remap HAND_TRACKER_RIGHT: getSharedMemoryFileDescriptor (Status(-1, EX_SECURITY): 'missing runtime permission(s)')  
05-14 17:14:42.993  6519  6537 W MemoryBrokerClient: Hands: failed to remap HAND_TRACKER_LEFT: getSharedMemoryFileDescriptor (Status(-1, EX_SECURITY): 'missing runtime permission(s)')
...
05-14 17:14:43.015  1394  1593 I input\_focus: \[Focus leaving 1bcbe39 [packageName]/com.mline.activity.MainActivity (server),reason=setFocusedWindow]: system\_server
05-14 17:14:43.016  1394  1593 I input\_focus: \[Focus entering a84fc08 com.oculus.vrshell/com.oculus.vrshell.FocusPlaceholderActivity (server),reason=setFocusedWindow]: system\_server
...
05-14 17:14:43.018  1849  1849 I ClientMgr: ClientMgr::SetFocusedClient: Updating focus state for all clients: com.oculus.vrruntimeservice
05-14 17:14:43.018  1849  1849 I ClientMgr: ClientMgr::SetFocusedClient: Updating Focus State: 0 for Client: [packageName]:6519, Client DisplayId: 0: com.oculus.vrruntimeservice
05-14 17:14:43.018  1849  1849 I ClientMgr: ClientMgr::SetFocusedClient: Updating Focus State: 0 for Client: com.oculus.vrguardianservice:3956, Client DisplayId: -1: com.oculus.vrruntimeservice
05-14 17:14:43.018  1849  1849 I ClientMgr: ClientMgr::SetFocusedClient: Updating Focus State: 1 for Client: com.oculus.vrshell:3151, Client DisplayId: -1: com.oculus.vrruntimeservice
05-14 17:14:43.018  1849  1849 I ClientMgr: ClientMgr::SetFocusedClient: Updating Focus State: 0 for Client: /system\_ext/bin/mrsystemservice:1167, Client DisplayId: 0: com.oculus.vrruntimeservice
05-14 17:14:43.018  1849  1849 I ClientMgr: SetFocusedPackageName - packageName com.oculus.vrshell processName com.oculus.vrshell clientId 3508380481 clientPid 3151: com.oculus.vrruntimeservice
 
then, 
Custom hand meshes from content no longer render  
Oculus default translucent hands appear, but do not respond to gestures.  
HandTracking features do not recover automatically, even after returning to the original activity or default lobby.
 
problem 2.
On first launch, media projection works correctly after the user grants permission.
 
However, after the device goes to sleep mode (press power button) then wakes up(press power button once again), and restart the MediaProjection, 
sometimes about 20% the problem 1 occured.
 
when these problems were appeared, restart com.oculus.vrshell using adb command : adb shell pm clear com.oculus.vrshell,
then the hand tracking is restored and input system also work again.
 
 
I'm looking for a reliable way to resolve this issue.
Ideally, we would appreciate it if Meta could fix this behavior at the system level, especially regarding the unexpected input focus hijacking by FocusPlaceholderActivity.
 
thanks.
0 REPLIES 0