• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[Tasker Profile (root)] Keep MotionSense active while listening to Spotify on PC

Do you face the described issue?

  • Yes, same problem

    Votes: 0 0.0%
  • Nope, you're the only one

    Votes: 0 0.0%

  • Total voters
    0
Search This thread

CiriousJoker

Member
Nov 30, 2016
25
3
When you listen to music on Spotify on your PC and have your smartphone next to you, I noticed that at some point the Spotify app will close and MotionSense will stop working (at least for me).
This Tasker profile will do the following:

Trigger
A notification from "Pixel Ambient Services" comes (read: "Song playing: ..."). While the song is playing, this notification even refreshes automatically.

Action
- Check if Spotify is running via "sudo ps -A | grep com.spotify.music"
- Launch Spotify if it isn't already open

Requirements
- root (ps without root will show nothing)
- Notification Listener (the built in Notification listener doesn't show the "Pixel Ambient Services" app for whatever reason)
- Be in range of your PC so your phone detects the song

Here is the Tasker profile as a link:
Profile
 

Attachments

  • Spotify_on_PC.prf.xml
    3.5 KB · Views: 14