benjymous/MWM-for-Android — pull request #24 by firetech (2012-05-15 10:21:36+00:00)
Title: Some fixes for the Actions app (and some cleanups along the way)

* Added support for "resettable" actions. A long press on the perform button resets the action (what a "reset" means is up to the action). This makes the Clicker action a bit more usable. :) (One idea for the future is to make a "reset" of notification items remove them from the list, in case they are secret or something.)

* Fixed the root cause of the disappearing notifications from the Action app. The problem was that MetaWatchService always called Idle.updateIdle() when an app said it used a button. I refactored the app button handling framework and made buttonPressed return an int instead and added three constants for this: BUTTON_NOT_USED (behaves as false did before), BUTTON_USED (behaves as true) and BUTTON_USED_DONT_UPDATE (behaves as true but suppresses the call to Idle.updateIdle).

* While I was at it, I also moved the MediaPlayerApp button handling from MetaWatchService to MediaPlayerApp's buttonPressed() method, and made the MediaControl methods all take a Context as parameter (instead of an AudioManager in some cases, that is).

I hope I didn't step on any toes doing this. It's just fun to refactor. ;)