private boolean shouldShowTos() {
   if (!this.mParams.showCarrierTos()) {
     return false;
   }
   String tosVersion = (String) BillingPreferences.ACCEPTED_CARRIER_TOS_VERSION.get();
   if (tosVersion == null || !tosVersion.equals(this.mProvisioning.getTosVersion())) {
     return true;
   }
   return false;
 }
 public void run(Runnable finishRunnable) {
   if (shouldFetchProvisioning(this.mDcbStorage)) {
     fetchProvisioning(
         (String) BillingPreferences.ACCEPTED_CARRIER_TOS_VERSION.get(),
         finishRunnable,
         finishRunnable);
     return;
   }
   if (finishRunnable != null) {
     finishRunnable.run();
   }
   FinskyLog.d("No need to fetch provisioning from carrier.", new Object[0]);
 }
 public void onAddCarrierBillingResult(AddResult result) {
   this.mAddResult = result;
   if (result == AddResult.SUCCESS) {
     BillingPreferences.ACCEPTED_CARRIER_TOS_VERSION.put(this.mTosVersion);
     showProgress();
     getProvisioning(new AfterProvisioning(), new AfterError());
   } else if (result == AddResult.EDIT_ADDRESS) {
     performNext();
   } else if (result == AddResult.CANCELED) {
     cancel();
   } else {
     showGenericError("Invalid error code.", "UNKNOWN");
   }
 }
 private void getProvisioning(Runnable onSuccess, Runnable onError) {
   new CarrierProvisioningAction()
       .forceRun(
           onSuccess, onError, (String) BillingPreferences.ACCEPTED_CARRIER_TOS_VERSION.get());
 }
 void performNext() {
   switch (AnonymousClass5
       .$SwitchMap$com$google$android$finsky$billing$carrierbilling$flow$CreateCarrierBillingFlow$State[
       this.mState.ordinal()]) {
     case com.google
         .android
         .wallet
         .instrumentmanager
         .R
         .styleable
         .WalletImFormEditText_validatorErrorString /*1*/:
       if (this.mAddressAvailable == AddressAvailable.NO_ADDRESS) {
         this.mState = State.SHOWING_EDIT_USERINFO;
         showEditAddressFragment(null);
         return;
       }
       this.mState = State.SHOWING_TOS_AND_USERINFO;
       showTosFragment();
       return;
     case com.google
         .android
         .wallet
         .instrumentmanager
         .R
         .styleable
         .WalletImFormEditText_validatorRegexp /*2*/:
       if (this.mAddResult == AddResult.EDIT_ADDRESS) {
         this.mState = State.SHOWING_EDIT_USERINFO;
         showEditAddressFragment(null);
         return;
       }
       this.mState = State.SENDING_REQUEST;
       showProgress();
       performRequest();
       return;
     case com.google
         .android
         .wallet
         .instrumentmanager
         .R
         .styleable
         .WalletImFormEditText_requiredErrorString /*3*/:
       this.mState = State.SHOWING_TOS_AND_USERINFO;
       showTosFragment();
       return;
     case com.google
         .android
         .wallet
         .instrumentmanager
         .R
         .styleable
         .WalletImFormEditText_required /*4*/:
       if (this.mUpdateInstrumentResponse.result == 0) {
         this.mState = State.DONE;
         finishWithUpdateInstrumentResponse(this.mUpdateInstrumentResponse);
         return;
       } else if (this.mUpdateInstrumentResponse.checkoutTokenRequired) {
         performRequest();
         return;
       } else {
         ArrayList<Integer> errorList = getRetriableErrorList();
         if (errorList == null || errorList.isEmpty()) {
           showGenericError("Could not add carrier billing instrument.", "UNKNOWN");
           return;
         }
         this.mState = State.SHOWING_EDIT_USERINFO;
         logError("INVALID_INPUT");
         showEditAddressFragment(errorList);
         return;
       }
     case com.google
         .android
         .wallet
         .instrumentmanager
         .R
         .styleable
         .WalletImFormEditText_validateWhenNotVisible /*5*/:
       BillingPreferences.ACCEPTED_CARRIER_TOS_VERSION.remove();
       if (shouldShowTos() || this.mAddressAvailable != AddressAvailable.NO_ADDRESS) {
         this.mState =
             this.mAddressAvailable == AddressAvailable.NO_ADDRESS
                 ? State.SHOWING_TOS
                 : State.SHOWING_TOS_AND_USERINFO;
         showTosFragment();
         return;
       }
       this.mState = State.SHOWING_EDIT_USERINFO;
       showEditAddressFragment(null);
       return;
     default:
       showGenericError("Invalid Dcb state.", "UNKNOWN");
       return;
   }
 }