1
Solved

Get Location v2 suspends all other tasks

Hey,

I noticed an issue with the "Get Location v2" action. It seems that the action suspends all other actions/tasks when the location update is running.

When I stop my car and the bluetooth connection to my mobile phone gets inactive, the variable %BluetoothConnection is set to "None", which triggers two pofiles to do an location update (Location Update@Out of Car) and check the audio profile settings (Check Audio Profile@Bluetooth).

According to the Tasker log (see below) both profiles are triggered and also both tasks (Force Location Update & Set Audio Profile) are started. But when the Get Location action runs, all other actions seems to be suspended.
You can see the 11 seconds delay between 00.41.01 and 00.41.12.

It happens since I've an Pixel 6. Worked fine for years with my Pixel 3 on Android 11.

20211121 00.03.46 E Stop     ID0:0.0  TaskService
20211121 00.41.01 P Inactive ID83     Bluetooth Connection@Car
20211121 00.41.01 E Start    ID0:0.0  TaskService
20211121 00.41.01 T Running  ID85     Var BluetoothConnection=None
20211121 00.41.01 A OK       ID85.1   Var BluetoothConnection=None.Var Set, %BluetoothConnection=None
20211121 00.41.01 T ExitOK   ID85     Var BluetoothConnection=None
20211121 00.41.01 E Stop     ID0:0.0  TaskService
20211121 00.41.01 P Inactive ID46     Location Update@Out of Car
20211121 00.41.01 E Start    ID0:0.0  TaskService
20211121 00.41.01 T Running  ID12     Force Location Update
20211121 00.41.01 A OK       ID12.1   Force Location Update.Force location update to get location immediatly
20211121 00.41.01 P Instant  ID138    Check Audio Profile@Bluetooth
20211121 00.41.01 T Running  ID125:2  Set Audio Profile
20211121 00.41.01 A OK       ID12.2   Force Location Update.
20211121 00.41.01 A OK       ID12.3   Force Location Update.Get Location v2
20211121 00.41.12 A OK       ID12.4   Force Location Update.If task started by Bluetooth Connection@Car profile, save coordinates of parking place.
20211121 00.41.12 A OK       ID125:2.1 Set Audio Profile.Audio profile "Car"
20211121 00.41.12 A OK       ID125:2.3 Set Audio Profile.Audio profile "Headset"
20211121 00.41.12 A OK       ID125:2.5 Set Audio Profile.Audio profile "Appointment"
20211121 00.41.12 A OK       ID125:2.7 Set Audio Profile.Audio profile "Work"
20211121 00.41.12 A OK       ID125:2.9 Set Audio Profile.Audio profile "Vibrate"
20211121 00.41.12 A OK       ID125:2.11 Set Audio Profile.Audio profile "Night"
20211121 00.41.12 A OK       ID125:2.13 Set Audio Profile.Last exit
20211121 00.41.12 T Running  ID10:3   Audio Profile "Default"
20211121 00.41.12 A OK       ID125:2.14 Set Audio Profile.Perform Task, Audio Profile "Default"
20211121 00.41.12 A OK       ID10:3.1 Audio Profile "Default".Notify Cancel
20211121 00.41.12 A OK       ID10:3.2 Audio Profile "Default".Media Volume
20211121 00.41.12 A OK       ID10:3.3 Audio Profile "Default".In-Call Volume
20211121 00.41.12 A OK       ID10:3.4 Audio Profile "Default".System Volume
20211121 00.41.12 A OK       ID10:3.5 Audio Profile "Default".Alarm Volume
20211121 00.41.13 A OK       ID10:3.6 Audio Profile "Default".Vibrate On Ringer
20211121 00.41.13 A OK       ID10:3.7 Audio Profile "Default".DnD Disable only when activated by Tasker before.
20211121 00.41.13 A OK       ID10:3.8 Audio Profile "Default".Do Not Disturb
20211121 00.41.13 A OK       ID10:3.9 Audio Profile "Default".Var Set, %DnD=False
20211121 00.41.13 A OK       ID10:3.10 Audio Profile "Default".End If
20211121 00.41.13 A OK       ID10:3.11 Audio Profile "Default".Var Set, %Audioprofil=Default
20211121 00.41.13 T ExitOK   ID10:3   Audio Profile "Default"

Thank you.

Jas Man

3 replies

J

Sorry for my late response. I was ill for the last weeks :(

It seems that changing the priority has solved the issue. Thank you!
But I'm still wondering why the location updates freezed the audio profile task.

It's just how the priority system in Tasker works :) Glad it works!

J

Sure :)
Thank you for your help.

Task: Force Location Update
    
    <Force location update to get location immediatly (e.g. for Airplane Mode during swimming)>
    A1: Anchor
    
    <This variable is used for checking if the location update is forced. Used e.g. by AirPlaneModeOn@Swimming profile to ensure, that the profil gets only active after a car drive and not during a walk in this area.>
    A2: Variable Set [
         Name: %ForcedLocUpdRunning
         To: True
         Max Rounding Digits: 3 ]
    
    A3: Get Location v2 [
         Timeout (Seconds): 60
         Minimum Accuracy (meters): 100
         Force High Accuracy: On
         Continue Task After Error:On ]
    
    <If task started by left car profile, save coordinates of parking place.>
    A4: Variable Set [
         Name: %CarParkingLocation
         To: %gl_latitude,%gl_longitude
         Max Rounding Digits: 3
         Structure Output (JSON, etc): On ]
        If  [ %caller1 ~ *Car* & %gl_latitude Set & %gl_longitude Set ]
    
    <Give some time to update location variables.>
    A5: Wait [
         MS: 0
         Seconds: 20
         Minutes: 0
         Hours: 0
         Days: 0 ]
    
    A6: Variable Set [
         Name: %ForcedLocUpdRunning
         To: False
         Max Rounding Digits: 3 ]
Task: Set Audio Profile
    Settings: Abort Existing Task
    
    <Audio profile "Car">
    A1: If [ %BluetoothConnection eq Car ]
    
        <Only if not already active to prevent reset of values.>
        A2: Perform Task [
             Name: Audio Profile "Car"
             Priority: %priority ]
            If  [ %Audioprofil neq Car ]
    
    <Audio profile "Headset">
    A3: Else
        If  [ %BluetoothConnection eq Headset ]
    
        <Only if not already active to prevent reset of values.>
        A4: Perform Task [
             Name: Audio Profile "Headset"
             Priority: %priority ]
            If  [ %Audioprofil neq Headset ]
    
    <Audio profile "Appointment">
    A5: Else
        If  [ %Appointment eq True & %Day eq True ]
    
        <Only if not already active to prevent reset of values.>
        A6: Perform Task [
             Name: Audio Profile "Appointment"
             Priority: %priority ]
            If  [ %Audioprofil neq Appointment ]
    
    <Audio profile "Work">
    A7: Else
        If  [ %Location eq Work & %Holiday neq True ]
    
        <Only if not already active to prevent reset of values.>
        A8: Perform Task [
             Name: Audio Profile "Work"
             Priority: %priority ]
            If  [ %Audioprofil neq Work ]
    
    <Audio profile "Vibrate">
    A9: Else
        If  [ %VibrateModeLocation eq True ]
    
        <Only if not already active to prevent reset of values.>
        A10: Perform Task [
              Name: Audio Profile "Vibrate"
              Priority: %priority ]
            If  [ %Audioprofil neq Vibrate ]
    
    <Audio profile "Night">
    A11: Else
        If  [ %Location eq Home & %Day eq False ]
    
        <Only if not already active to prevent reset of values.>
        A12: Perform Task [
              Name: Audio Profile "Night"
              Priority: %priority ]
            If  [ %Audioprofil neq Night ]
    
    <Last exit>
    A13: Else
    
        A14: Perform Task [
              Name: Audio Profile "Default"
              Priority: %priority ]
            If  [ %Audioprofil neq Default ]
    
    A15: End If
Task: Audio Profile "Default"
    
    A1: Notify Cancel [
         Title: Profil ]
    
    A2: Media Volume [
         Level: 5 ]
    
    A3: In-Call Volume [
         Level: 5 ]
    
    A4: System Volume [
         Level: 5 ]
    
    A5: Alarm Volume [
         Level: 5 ]
    
    A6: Vibrate On Ringer [
         Set: On ]
    
    <DnD
    Disable only when activated by Tasker.>
    A7: If [ %INTERRUPT neq all & %DnD eq True ]
    
        A8: Do Not Disturb [
             Mode: Allow All
             Allow Callers: Any
             Allow SMS Senders: None
             Allow Categories: Alarms ]
    
        A9: Variable Set [
             Name: %DnD
             To: False
             Max Rounding Digits: 3
             Structure Output (JSON, etc): On ]
    
    A10: End If
    
    A11: Variable Set [
          Name: %Audioprofil
          To: Default
          Max Rounding Digits: 3 ]

Is it possible that both tasks have the same priority? Try using a lower priority in the location task and see if that fixes it. Thanks

Can you please export your tasks' descriptions (not xml) so I can take a look? Long-click the task in Tasker->export description Thanks in advance

Topic is closed for comments