Pixel 4’s Motion Sense Gestures can now be Remapped [Root]
Google’s Pixel 4 is the first smartphone with the Soli radar for gesture detection. Although Google’s early demos of Soli showed off extremely precise hand gesture detection, what we got in the Pixel 4 hasn’t lived up to the initial hype. Currently, you can either flick left/right to skip tracks, swipe in any direction to mute incoming calls/timers/alarms, or reach to wake the phone up. What’s even worse is the fact that the skip track gesture only works with 23 media apps. Fortunately, as was the case with the regional restriction, the XDA community has come up with a solution to improve Motion Sense.
Currently, only the built-in Motion Sense app and two demo games, Pokemon Wave Hello and Headed South, are able to work with gestures. Last week, Google told AndroidPolice that the company has no immediate plans to open up the Motion Sense API for third-party developers. That hasn’t stopped XDA Senior Member ashergray, though. They modified the built-in Motion Sense Bridge app, the app that lets Pokemon Wave Hello and Headed South use Motion Sense gestures, to send implicit broadcast intents whenever Reach, Presence, Swipe, or Flick gestures are detected. Installing this modified Bridge app requires root access, though, because the developer had to disable Google’s signature protection.
ashergray also created a companion app called “OsloBridger” that lets you control which broadcast intents are sent, and it even lets you adjust the sensitivity, distance, and granularity of all supported gestures. The app creates a foreground service so gesture events are broadcast even when the screen is off.
The developer intends for this mod to be used with an automation app like Tasker. In Tasker, you can react to Motion Sense gesture events by creating a new Profile with the “Intent Received” Event context. In the “Action” field, put the intent action that you enabled in OsloBridger. Here are the 4 intents that are supported:
- Reach Gesture Intent: com.jcarletto.oslobridger.REACH_GESTURE
- Presence Gesture Intent: com.jcarletto.oslobridger.PRESENCE_GESTURE
- Swipe Gesture Intent: com.jcarletto.oslobridger.SWIPE_GESTURE
- Flick Gesture Intent: com.jcarletto.oslobridger.FLICK_GESTURE
In the actual Task, any intent extras are stored in the local variable with the corresponding name. For example, when the FLICK_GESTURE intent is received, the “direction” intent extra can be accessed in Tasker via the %direction local variable. In this particular case, the %direction variable holds either 1, 5, 3, or 7 for East, West, North, or South respectively. If you’re going to remap any of the gestures using this mod, then I recommend you disable the original gestures in Settings > System > Motion Sense so there isn’t any interference.
With this mod, you can basically do whatever you want with the Pixel 4’s Motion Sense gestures. You can enable the skip track gesture for any media app. You can enable flick gestures that increase or decrease the volume. It’s up to you.
If you have any questions or want to leave feedback for this mod, visit the OsloBridger Magisk Module thread on our forums. You can download the Magisk Module from the developer’s GitHub page here. The Readme on the developer’s GitHub also explains each of the parameters and options you’ll find in the OsloBridger app.