public static void PurchaseResponse(Context context, Consts.PurchaseState purchaseState, string productId, string orderId, long purchaseTime, string developerPayload)
{
// 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.
//JAVA TO C# CONVERTER TODO TASK: Anonymous inner classes are not converted to C# if the base type is not defined in the code being converted:
new Thread(new Runnable(() =>
{
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.
lock (context)
{
if (sPurchaseObserver != null)
{
sPurchaseObserver.PostPurchaseStateChange(purchaseState, productId, quantity, purchaseTime, developerPayload);
}
}
})).Start();
}