Code cleanup

pull/14/head
Sam Bosley 12 years ago
parent 6039b9e01b
commit d71c353f42

@ -12,9 +12,9 @@ public class BillingConstants {
// Intent actions that we send from the BillingReceiver to the
// BillingService. Defined by this application.
public static final String ACTION_CONFIRM_NOTIFICATION = "com.example.subscriptions.CONFIRM_NOTIFICATION";
public static final String ACTION_GET_PURCHASE_INFORMATION = "com.example.subscriptions.GET_PURCHASE_INFORMATION";
public static final String ACTION_RESTORE_TRANSACTIONS = "com.example.subscriptions.RESTORE_TRANSACTIONS";
public static final String ACTION_CONFIRM_NOTIFICATION = "com.timsu.astrid.subscriptions.CONFIRM_NOTIFICATION";
public static final String ACTION_GET_PURCHASE_INFORMATION = "com.timsu.astrid.subscriptions.GET_PURCHASE_INFORMATION";
public static final String ACTION_RESTORE_TRANSACTIONS = "com.timsu.astrid.subscriptions.RESTORE_TRANSACTIONS";
// Intent actions that we receive in the BillingReceiver from Market.
// These are defined by Market and cannot be changed.
@ -62,7 +62,7 @@ public class BillingConstants {
public static final char PUB_KEY_REPLACE_CHAR = 'B';
public static final String PUB_KEY_OBFUSCATED = "pubkey";
public static final boolean DEBUG = true || Constants.DEBUG;
public static final boolean DEBUG = false || Constants.DEBUG;
// The response codes for a request, defined by Android Market.
public enum ResponseCode {

@ -160,19 +160,6 @@ public class BillingService extends Service implements ServiceConnection {
class CheckBillingSupported extends BillingRequest {
public String mProductType = null;
// /** Legacy contrustor
// *
// * This constructor is provided for legacy purposes. Assumes the calling application will
// * not be using any features not present in API v1, such as subscriptions.
// */
// @Deprecated
// public CheckBillingSupported() {
// // This object is never created as a side effect of starting this
// // service so we pass -1 as the startId to indicate that we should
// // not stop this service after executing this request.
// super(-1);
// }
/** Constructor
*
* Note: Support for subscriptions implies support for one-time purchases. However, the
@ -215,27 +202,6 @@ public class BillingService extends Service implements ServiceConnection {
public final String mDeveloperPayload;
public final String mProductType;
// /** Legacy constructor
// *
// * @param itemId The ID of the item to be purchased. Will be assumed to be a one-time
// * purchase.
// */
// @Deprecated
// public RequestPurchase(String itemId) {
// this(itemId, null, null);
// }
//
// /** Legacy constructor
// *
// * @param itemId The ID of the item to be purchased. Will be assumed to be a one-time
// * purchase.
// * @param developerPayload Optional data.
// */
// @Deprecated
// public RequestPurchase(String itemId, String developerPayload) {
// this(itemId, null, developerPayload);
// }
/** Constructor
*
* @param itemId The ID of the item to be purchased. Will be assumed to be a one-time
@ -452,16 +418,6 @@ public class BillingService extends Service implements ServiceConnection {
}
return false;
}
//
// /**
// * Checks if in-app billing is supported. Assumes this is a one-time purchase.
// *
// * @return true if supported; false otherwise
// */
// @Deprecated
// public boolean checkBillingSupported() {
// return new CheckBillingSupported().runRequest();
// }
/**
* Checks if in-app billing is supported.

@ -75,7 +75,7 @@ public class ResponseHandler {
public static void buyPageIntentResponse(PendingIntent pendingIntent, Intent intent) {
if (sPurchaseObserver == null) {
if (BillingConstants.DEBUG) {
Log.d(TAG, "UI is not running");
Log.d(TAG, "UI is not running"); //$NON-NLS-1$
}
return;
}
@ -105,18 +105,9 @@ public class ResponseHandler {
final Context context, final PurchaseState purchaseState, final String productId,
final String orderId, final long purchaseTime, final String developerPayload, final String purchaseToken) {
// Update the database with the purchase state. We shouldn't do that
// from the main thread so we do the work in a background thread.
// We don't update the UI here. We will update the UI after we update
// the database because we need to read and update the current quantity
// first.
new Thread(new Runnable() {
@Override
public void run() {
// PurchaseDatabase db = new PurchaseDatabase(context);
// int quantity = db.updatePurchase(
// orderId, productId, purchaseState, purchaseTime, developerPayload);
// db.close();
// This needs to be synchronized because the UI thread can change the
// value of sPurchaseObserver.

Loading…
Cancel
Save