Billing should only be supported for the default Android market strategy

pull/14/head
Sam Bosley 12 years ago
parent 6c4758b3fb
commit 41419f5a5f

@ -106,7 +106,8 @@ public class ActFmPreferences extends SyncProviderPreferences {
super.onResume();
Preference premiumUpgrade = findPreference(getString(R.string.actfm_inapp_billing));
if (premiumUpgrade != null && (!actFmPreferenceService.isLoggedIn() || ActFmPreferenceService.isPremiumUser())) {
if (premiumUpgrade != null &&
(!Constants.MARKET_STRATEGY.billingSupported() || !actFmPreferenceService.isLoggedIn() || ActFmPreferenceService.isPremiumUser())) {
getPreferenceScreen().removePreference(premiumUpgrade);
}
}

@ -52,6 +52,15 @@ public abstract class MarketStrategy {
return true;
}
/**
* Most market strategies don't support billing at this time,
* so we'll make the default false
* @return
*/
public boolean billingSupported() {
return false;
}
public static class NoMarketStrategy extends MarketStrategy {
@Override
public Intent generateMarketLink(String packageName) {
@ -78,6 +87,11 @@ public abstract class MarketStrategy {
return "android_market"; //$NON-NLS-1$
}
@Override
public boolean billingSupported() {
return true;
}
}
public static class WebMarketStrategy extends MarketStrategy {

Loading…
Cancel
Save