[android] Fixed purchase validation with null server id

[android] Allowed not to impelement AlertDialogCallback when it's no needed
This commit is contained in:
Александр Зацепин 2018-11-27 14:54:06 +03:00 committed by Olesia Bolovintseva
parent c4de0ff211
commit 761edcd596
4 changed files with 7 additions and 4 deletions

View file

@ -492,7 +492,7 @@ public class Framework
public static native void nativeStartPurchaseTransactionListener(@Nullable
StartTransactionListener listener);
public static native void nativeValidatePurchase(@Nullable String serverId,
public static native void nativeValidatePurchase(@NonNull String serverId,
@NonNull String vendorId,
@NonNull String purchaseData);
public static native void nativeSetPurchaseValidationListener(@Nullable

View file

@ -321,7 +321,6 @@ public class BookmarksCatalogFragment extends BaseWebViewMwmFragment
return;
}
UiUtils.show(mProgressView);
UiUtils.hide(mRetryBtn);
mWebView.loadUrl(getCatalogUrlOrThrow());

View file

@ -12,6 +12,8 @@ import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import com.mapswithme.maps.base.BaseMwmDialogFragment;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
public class AlertDialog extends BaseMwmDialogFragment
{
@ -61,7 +63,9 @@ public class AlertDialog extends BaseMwmDialogFragment
}
catch (ClassCastException e)
{
throw new ClassCastException("Caller must implement AlertDialogCallback interface!");
Logger logger = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
logger.w(AlertDialog.class.getSimpleName(),
"Caller doesn't implement AlertDialogCallback interface.");
}
}

View file

@ -35,7 +35,7 @@ class DefaultPurchaseValidator implements PurchaseValidator<ValidationCallback>,
@NonNull String purchaseData)
{
String encodedData = Base64.encodeToString(purchaseData.getBytes(), Base64.DEFAULT);
Framework.nativeValidatePurchase(serverId, vendor, encodedData);
Framework.nativeValidatePurchase(serverId == null ? "" : serverId, vendor, encodedData);
}
@Override