forked from organicmaps/organicmaps
[android] Fixed purchase validation with null server id
[android] Allowed not to impelement AlertDialogCallback when it's no needed
This commit is contained in:
parent
c4de0ff211
commit
761edcd596
4 changed files with 7 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -321,7 +321,6 @@ public class BookmarksCatalogFragment extends BaseWebViewMwmFragment
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
UiUtils.show(mProgressView);
|
||||
UiUtils.hide(mRetryBtn);
|
||||
mWebView.loadUrl(getCatalogUrlOrThrow());
|
||||
|
|
|
@ -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.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue