Monday 30 May 2011

Plugins be gone

So a quick follow up to the last post. When Llama updates Minimalistic Text Widget, it does so by sending a broadcast named com.twofortyfouram.locale.intent.action.FIRE_SETTING. This is what Minimalistic Text Widget looks for when it watches for updates. This broadcast also contains two pieces of information de.devmil.minimaltext.locale.extras.VAR_NAME and de.devmil.minimaltext.locale.extras.VAR_TEXT, which contains either llamaprofile, llamaareas, the names of areas or the name of the current profile.
A downside to this approach is that every plugin/app that wants to receive the FIRE_SETTING broadcast will receive it. It's then up to the plugin to decide what to do with the broadcast. A good plugin would check to see if the contents of the broadcast were not relevant and then ignore it. As it turns out, there are some plugins/apps that will perform an action upon receiving the broadcast, even if the broadcast wasn't meant for them. See edits below.

So for now, Minimalistic Text Widget support has been turned off. I can't act as the middle-man between someone that has a broken plugin and the developer of that plugin. Instead, I've kindly asked the Minimalistic Text Widget dev to support his own broadcast name. That way anything destined for Minimalistic Text Widget won't get sent to any other apps. Also, other new apps won't have to worry about weird stuff happening when they update Minimalistic Text Widget.
Many thanks to the Minimalistic Text Widget dev for his help!

EDIT: Looks like a really easy fix is to set the package and class name of the broadcast to the package and class name of Minimalistic Text Widget's broadcast receiver. But that's a job for another day. Now is sleep time :)

EDIT: This post was written during the initial-rage of unhelpful comments appearing on the market. After looking over the documentation of a Locale plugin, Llama shouldn't have been sending a broadcast to everything that watches for com.twofortyfouram.locale.intent.action.FIRE_SETTING. I've updated the Minimalistic Text Widget wiki accordingly, so now only Minimalistic Text Widget is targeted by the broadcast. Look at the latest blog posts for a test version.