Skip to content

Commit

Permalink
Add annotations, permission automatically added
Browse files Browse the repository at this point in the history
  • Loading branch information
jberkel committed Oct 29, 2017
1 parent 5fe0e24 commit 7e1c9e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.USE_CREDENTIALS"/>
<uses-permission android:name="com.android.vending.BILLING"/>

<uses-feature android:name="android.hardware.telephony" android:required="false"/>
<uses-feature android:name="android.hardware.wifi" android:required="false"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
import android.support.annotation.Nullable;
import com.android.billingclient.api.BillingClient;
import com.android.billingclient.api.BillingClient.BillingResponse;
import com.android.billingclient.api.BillingClientStateListener;
import com.android.billingclient.api.BillingFlowParams;
import com.android.billingclient.api.Purchase;
Expand Down Expand Up @@ -51,7 +53,7 @@ public void onCreate(Bundle savedInstanceState) {
billingClient = BillingClient.newBuilder(this).setListener(this).build();
billingClient.startConnection(new BillingClientStateListener() {
@Override
public void onBillingSetupFinished(int resultCode) {
public void onBillingSetupFinished(@BillingResponse int resultCode) {
Log.d(TAG, "onBillingSetupFinished(" + resultCode + ")" + Thread.currentThread().getName());
switch (resultCode) {
case OK:
Expand Down Expand Up @@ -81,7 +83,7 @@ protected void onDestroy() {
}

@Override
public void onSkuDetailsResponse(int responseCode, List<SkuDetails> details) {
public void onSkuDetailsResponse(@BillingResponse int responseCode, List<SkuDetails> details) {
log("onSkuDetailsResponse(" + responseCode + ", " + details + ")");

if (responseCode != OK) {
Expand Down Expand Up @@ -167,7 +169,7 @@ public void onCancel(DialogInterface dialogInterface) {
}

@Override
public void onPurchasesUpdated(int responseCode, List<Purchase> purchases) {
public void onPurchasesUpdated(@BillingResponse int responseCode, @Nullable List<Purchase> purchases) {
log("onIabPurchaseFinished(" + responseCode + ", " + purchases);
if (responseCode == OK) {
Toast.makeText(this,
Expand Down

0 comments on commit 7e1c9e4

Please sign in to comment.