onepf/OpenIAB — pull request #365 by ataulm (2014-10-06 12:06:55+00:00)
Title: Add check for STATE_DISPOSED in finishSetup()

In our application, we use `OpenIabHelper.startSetup()` in our `onCreate()` method and `OpenIabHelper.dispose()` in our `onDestroy()` method.

If the activity is recreated (e.g. by the system as a result of a screen orientation change), then `dispose()` is called, and we setup a new OpenIabHelper. The asynchronous setup ignores this state change (to `STATE_DISPOSED`), and will throw `IllegalStateException` when the setup is finished.

At this point, we don't care about _that_ OpenIabHelper finishing the setup, we only want a callback when the new one is done.

This PR adds this state check in `finishSetup()` returning without action (except logging a warning) if the state is `STATE_DISPOSED`.