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.
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
-
skylarsutton
commented
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.