Skip to content

Commit

Permalink
🚀[ Release v.2.8.4] Merge into Develop (litecoin-foundation#141)
Browse files Browse the repository at this point in the history
* updated privacy policy location

- code bump

* polished the sync duration

- adjusted the sync output
  • Loading branch information
kcw-grunt authored May 26, 2023
1 parent 1f544a0 commit c26ce3f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ android {
applicationId = 'com.loafwallet'
minSdkVersion 27
targetSdkVersion 32
versionCode 730
versionCode 733
versionName "v2.8.4"
multiDexEnabled true
archivesBaseName = "${versionName}(${versionCode})"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private BRConstants() {
public static final String INSTAGRAM_LINK = "https://www.instagram.com/litewallet.app";

public static final String WEB_LINK = "https://litewallet.io";
public static final String TOS_LINK = "https://litewallet.io/privacy/policy.html";
public static final String TOS_LINK = "https://litewallet.io/privacy";
public static String CUSTOMER_SUPPORT_LINK = "https://support.litewallet.io";
public static String BITREFILL_AFFILIATE_LINK = "https://www.bitrefill.com/";

Expand Down
26 changes: 17 additions & 9 deletions app/src/main/java/com/breadwallet/wallet/BRPeerManager.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.breadwallet.wallet;

import static java.lang.Math.abs;

import android.content.Context;

import androidx.annotation.WorkerThread;
Expand Down Expand Up @@ -58,7 +60,7 @@ public static BRPeerManager getInstance() {
public static void syncStarted() {
syncStartDate = new Date().getTime();
long syncCompletedDate = new Date().getTime();
Timber.d("timber: syncStarted: %s startDate: %s", Thread.currentThread().getName(), syncStartDate);
Timber.d("timber: syncStarted (unix epoch ms): %s startDate: %s", Thread.currentThread().getName(), syncStartDate);
Context ctx = BreadApp.getBreadContext();
int startHeight = BRSharedPrefs.getStartHeight(ctx);
int lastHeight = BRSharedPrefs.getLastBlockHeight(ctx);
Expand All @@ -68,22 +70,28 @@ public static void syncStarted() {

public static void syncSucceeded() {
syncCompletedDate = new Date().getTime();
Timber.d("timber: syncSucceeded completed at: %s", syncCompletedDate);
Timber.d("timber: sync started(unix epoch ms): %s, completed(unix epoch ms): %s", syncStartDate, syncCompletedDate);
final Context app = BreadApp.getBreadContext();
if (app == null) return;
BRSharedPrefs.putLastSyncTime(app, System.currentTimeMillis());
SyncManager.getInstance().updateAlarms(app);
BRSharedPrefs.putAllowSpend(app, true);
SyncManager.getInstance().stopSyncingProgressThread();

long syncTimeElapsed = syncCompletedDate - syncStartDate;
long syncTimeElapsed = abs(syncCompletedDate - syncStartDate) / 1000;
float userFalsePositiveRate = BRSharedPrefs.getFalsePositivesRate(app);

Bundle params = new Bundle();
params.putLong("sync_time_elapsed", syncTimeElapsed);
params.putFloat("user_preferred_fprate",userFalsePositiveRate);

AnalyticsManager.logCustomEventWithParams(BRConstants._20230407_DCS, params);
Timber.d("timber: syncTimeElapsed duration (seconds): %s", syncTimeElapsed);

/// Need to filter partial syncs to properly track averages
/// this will filter out any syncs from 19 minutes to 120 minutes
/// The assumption is daily normal syncs are not problematic and quick
/// and any syncs past 120 minutes are errorneous in terms of data collection and testing
if (syncTimeElapsed > 19 * 60 && syncTimeElapsed > 120 * 60 ) {
Bundle params = new Bundle();
params.putLong("sync_time_elapsed", syncTimeElapsed);
params.putFloat("user_preferred_fprate", userFalsePositiveRate);
AnalyticsManager.logCustomEventWithParams(BRConstants._20230407_DCS, params);
}
BRExecutor.getInstance().forLightWeightBackgroundTasks().execute(new Runnable() {
@Override
public void run() {
Expand Down

0 comments on commit c26ce3f

Please sign in to comment.