I suggest you ...

Allow ACTION_REQUEST_QUERY to send contextual data

As it stands today, some phone features require us to listen to phone broadcasts and trigger a locale re-query when statuses change. There is no way to convey that "current status" from the broadcast receiver listening to the phone into the broadcast receiver that locale queries.

I would suggest letting developers add extra's to the ACTION_REQUEST_QUERY intent and having locale re-broadcast those extras when it queries the condition.

1 vote
Vote 0 votes Vote Vote
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service

    You'll receive a confirmation email with a link to create a password (optional).

    Signed in as (Sign out)
    You have left! (?) (thinking…)
    skylarsuttonskylarsutton shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    declined  ·  CarterAdminCarter (Admin, two forty four a.m.) responded  · 

    Hi Skylar,

    You might try using persistent storage (like SharedPreferences) to share state across different objects, such as two different BroadcastReceivers. SharedPreferences are secure, thread-safe, and persist across launches of a process.

    Forwarding extras via ACTION_REQUEST_REQUERY creates a security hole. Imagine a malicious app sending ACTION_REQUEST_REQUERY with forged extras to Locale, Locale forwards those extras to the plug-in, and the plug-in inaccurately reports its satisfied state to Locale based on the forged extras.

    Locale’s current implementation sends an ordered ACTION_QUERY broadcast directly to a plug-in’s BroadcastReceiver by component name. This ensures that only Locale and the intended plug-in receive the Intent. I hope this helps!

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service

      You'll receive a confirmation email with a link to create a password (optional).

      Signed in as (Sign out)
      Submitting...
      • skylarsuttonskylarsutton commented  ·   ·  Flag as inappropriate

        Alternatively, you could allow plugins to broadcast a new type of intent that signals a condition is satisfied. This would skip the "requery" process, as the receiver listening to the phone events is already aware that the locale condition is satisfied.

      Knowledge Base and Helpdesk