Back to project page android-store.
The source code is released under:
Copyright (c) 2012 SOOMLA http://project.soom.la/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to...
If you think the Android project android-store listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.soomla.store; /*from w ww .java2s . com*/ import android.os.Build; import com.soomla.BusProvider; import com.soomla.SoomlaApp; import com.soomla.store.events.MarketPurchaseCancelledEvent; import com.soomla.store.events.MarketPurchaseEvent; import com.soomla.store.events.MarketPurchaseStartedEvent; import com.soomla.store.events.UnexpectedStoreErrorEvent; import com.squareup.otto.Subscribe; public class StoreForeground { private StoreForeground() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { BusProvider.getInstance().register(this); } } public static synchronized StoreForeground get() { if (sInstance == null) { sInstance = new StoreForeground(); } return sInstance; } private static StoreForeground sInstance; @Subscribe public void onMarketPurchaseEvent(MarketPurchaseEvent marketPurchaseEvent) { if (SoomlaApp.ForegroundService != null) { SoomlaApp.ForegroundService.OutsideOperation = false; } } @Subscribe public void onMarketPurchaseCancelledEvent(MarketPurchaseCancelledEvent marketPurchaseCancelledEvent) { if (SoomlaApp.ForegroundService != null) { SoomlaApp.ForegroundService.OutsideOperation = false; } } @Subscribe public void onMarketPurchaseStartedEvent(MarketPurchaseStartedEvent marketPurchaseStartedEvent) { if (SoomlaApp.ForegroundService != null) { SoomlaApp.ForegroundService.OutsideOperation = true; } } @Subscribe public void onUnexpectedStoreErrorEvent(UnexpectedStoreErrorEvent unexpectedStoreErrorEvent) { if (SoomlaApp.ForegroundService != null) { SoomlaApp.ForegroundService.OutsideOperation = false; } } }