dankurka/gwtphonegap — pull request #2 by manolo (2012-08-10 09:44:53+00:00)
Title: Fix a random condition which was causing firePhoneGapAvailable called twice

When nativeDeviceReady is called, it should just set to true the deviceReady flag but not fire the phonegap-available-event because the user could not have set the availableHandler or she could not have called the initialize.

initializePhonegap is the responsible to fire that event whenever it realizes the device is ready.

Issues fixed:
- Sometimes the available event was being called twice: one from the nativeDeviceReady method, and another from the initializePhoneGap (line 99)
- Sometimes the firePhoneGapAvailable was called before the initializePhonegap call
- Under certain circumstances PhoneGapAvailableHandler could be never called (i have not seen this condition but I think it was possible).