From 603f32df6340ded72789aa0841a076b1e582c6c5 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Thu, 22 Apr 2021 16:54:12 +0300 Subject: [PATCH] Fix test backup screen --- OsmAnd/src/net/osmand/plus/backup/BackupHelper.java | 9 ++++----- .../net/osmand/plus/development/TestBackupActivity.java | 5 ----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/backup/BackupHelper.java b/OsmAnd/src/net/osmand/plus/backup/BackupHelper.java index be81017d42..326315b7d1 100644 --- a/OsmAnd/src/net/osmand/plus/backup/BackupHelper.java +++ b/OsmAnd/src/net/osmand/plus/backup/BackupHelper.java @@ -131,10 +131,6 @@ public class BackupHelper { return token.matches("[0-9]+"); } - public boolean hasOsmLiveUpdates() { - return InAppPurchaseHelper.isSubscribedToLiveUpdates(app); - } - @Nullable public String getOrderId() { InAppPurchaseHelper purchaseHelper = app.getInAppPurchaseHelper(); @@ -167,7 +163,10 @@ public class BackupHelper { public void registerUser(@NonNull String email, @Nullable final OnRegisterUserListener listener) { Map params = new HashMap<>(); params.put("email", email); - params.put("orderid", getOrderId()); + String orderId = getOrderId(); + if (!Algorithms.isEmpty(orderId)) { + params.put("orderid", orderId); + } params.put("deviceid", app.getUserAndroidId()); AndroidNetworkUtils.sendRequestAsync(app, USER_REGISTER_URL, params, "Register user", true, true, new OnRequestResultListener() { @Override diff --git a/OsmAnd/src/net/osmand/plus/development/TestBackupActivity.java b/OsmAnd/src/net/osmand/plus/development/TestBackupActivity.java index a5d0daddf5..3b38b1469b 100644 --- a/OsmAnd/src/net/osmand/plus/development/TestBackupActivity.java +++ b/OsmAnd/src/net/osmand/plus/development/TestBackupActivity.java @@ -89,11 +89,6 @@ public class TestBackupActivity extends OsmandActionBarActivity { } }); - if (!backupHelper.hasOsmLiveUpdates()) { - findViewById(R.id.main_view).setVisibility(View.GONE); - return; - } - buttonRegister = findViewById(R.id.btn_register); UiUtilities.setupDialogButton(nightMode, buttonRegister, DialogButtonType.PRIMARY, "Register"); buttonVerify = findViewById(R.id.btn_verify);