Skip to content

Commit

Permalink
Adjust log level
Browse files Browse the repository at this point in the history
  • Loading branch information
jberkel committed Oct 29, 2017
1 parent 37fabff commit cb93922
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import static com.android.billingclient.api.BillingClient.BillingResponse.OK;
import static com.android.billingclient.api.BillingClient.BillingResponse.USER_CANCELED;
import static com.android.billingclient.api.BillingClient.SkuType.INAPP;
import static com.zegoggles.smssync.App.LOCAL_LOGV;
import static com.zegoggles.smssync.App.TAG;
import static com.zegoggles.smssync.Consts.Billing.ALL_SKUS;
import static com.zegoggles.smssync.Consts.Billing.DONATION_PREFIX;
Expand Down Expand Up @@ -219,13 +220,17 @@ public static void checkUserHasDonated(Context c, final DonationStatusListener l
final BillingClient helper = BillingClient.newBuilder(c).setListener(new PurchasesUpdatedListener() {
@Override
public void onPurchasesUpdated(int responseCode, List<Purchase> purchases) {
Log.d(TAG, "onPurchasesUpdated("+responseCode+")");
if (LOCAL_LOGV) {
Log.v(TAG, "onPurchasesUpdated(" + responseCode + ")");
}
}
}).build();
helper.startConnection(new BillingClientStateListener() {
@Override
public void onBillingSetupFinished(int resultCode) {
Log.d(TAG, "checkUserHasDonated: onBillingSetupFinished("+resultCode+")");
public void onBillingSetupFinished(@BillingResponse int resultCode) {
if (LOCAL_LOGV) {
Log.v(TAG, "checkUserHasDonated: onBillingSetupFinished("+resultCode+")");
}
if (resultCode == OK) {
Purchase.PurchasesResult result = helper.queryPurchases(INAPP);
if (result.getResponseCode() == OK) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import static com.firebase.jobdispatcher.FirebaseJobDispatcher.CANCEL_RESULT_SUCCESS;
import static com.firebase.jobdispatcher.FirebaseJobDispatcher.SCHEDULE_RESULT_SUCCESS;
import static com.firebase.jobdispatcher.FirebaseJobDispatcher.SCHEDULE_RESULT_UNSUPPORTED_TRIGGER;
import static com.zegoggles.smssync.App.LOCAL_LOGV;
import static com.zegoggles.smssync.App.TAG;
import static com.zegoggles.smssync.service.BackupType.UNKNOWN;

Expand All @@ -51,7 +52,9 @@ class AlarmManagerDriver implements Driver, JobValidator {

@Override
public int schedule(Job job) {
Log.d(TAG, "AlarmManagerDriver: schedule " +job);
if (LOCAL_LOGV) {
Log.v(TAG, "AlarmManagerDriver: schedule " +job);
}

final JobTrigger trigger = job.getTrigger();
final long atTime = scheduleTime(trigger);
Expand All @@ -61,20 +64,25 @@ public int schedule(Job job) {

return SCHEDULE_RESULT_SUCCESS;
} else {
Log.w(TAG, "unsupported trigger for job "+job);
return SCHEDULE_RESULT_UNSUPPORTED_TRIGGER;
}
}

@Override
public int cancel(String tag) {
Log.d(TAG, "AlarmManagerDriver: cancel " +tag);
if (LOCAL_LOGV) {
Log.v(TAG, "AlarmManagerDriver: cancel " +tag);
}
alarmManager.cancel(createPendingIntent(context, BackupType.fromName(tag)));
return CANCEL_RESULT_SUCCESS;
}

@Override
public int cancelAll() {
Log.d(TAG, "AlarmManagerDriver: cancelAll");
if (LOCAL_LOGV) {
Log.v(TAG, "AlarmManagerDriver: cancelAll");
}
// Matching intents based on Intent#filterEquals():
// That is, if their action, data, type, class, and categories are the same.
alarmManager.cancel(createPendingIntent(context, UNKNOWN));
Expand Down

0 comments on commit cb93922

Please sign in to comment.