diff --git a/app/build.gradle b/app/build.gradle index 4b1a2716..1442d415 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,8 +14,8 @@ android { applicationId "io.lbry.browser" minSdkVersion 21 targetSdkVersion 29 - versionCode 1600 - versionName "0.16.0" + versionCode 1601 + versionName "0.16.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/java/io/lbry/browser/MainActivity.java b/app/src/main/java/io/lbry/browser/MainActivity.java index 3ac9a75c..bec1daf8 100644 --- a/app/src/main/java/io/lbry/browser/MainActivity.java +++ b/app/src/main/java/io/lbry/browser/MainActivity.java @@ -292,6 +292,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener public static final String PREFERENCE_KEY_NOTIFICATION_CREATOR = "io.lbry.browser.preference.notifications.Creator"; public static final String PREFERENCE_KEY_KEEP_SDK_BACKGROUND = "io.lbry.browser.preference.other.KeepSdkInBackground"; public static final String PREFERENCE_KEY_PARTICIPATE_DATA_NETWORK = "io.lbry.browser.preference.other.ParticipateInDataNetwork"; + public static final String PREFERENCE_KEY_SEND_BUFFERING_EVENTS = "io.lbry.browser.preference.other.SendBufferingEvents"; // Internal flags / setting preferences public static final String PREFERENCE_KEY_INTERNAL_SKIP_WALLET_ACCOUNT = "io.lbry.browser.preference.internal.WalletSkipAccount"; @@ -2648,9 +2649,9 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener try { LbryUri uri = LbryUri.parse(url); if (uri.isChannel()) { - openChannelUrl(uri.toString()); + openChannelUrl(url); } else { - openFileUrl(uri.toString()); + openFileUrl(url); } } catch (LbryUriException ex) { // pass diff --git a/app/src/main/java/io/lbry/browser/adapter/NotificationListAdapter.java b/app/src/main/java/io/lbry/browser/adapter/NotificationListAdapter.java index a948a7ee..cfdba94c 100644 --- a/app/src/main/java/io/lbry/browser/adapter/NotificationListAdapter.java +++ b/app/src/main/java/io/lbry/browser/adapter/NotificationListAdapter.java @@ -159,7 +159,8 @@ public class NotificationListAdapter extends RecyclerView.Adapter 0) { + Context ctx = getContext(); + boolean sendBufferingEvents = true; + + if (ctx != null) { + SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(ctx); + sendBufferingEvents = sp.getBoolean(MainActivity.PREFERENCE_KEY_SEND_BUFFERING_EVENTS, true); + } + + if (MainActivity.appPlayer != null && MainActivity.appPlayer.getCurrentPosition() > 0 && sendBufferingEvents) { // we only want to log a buffer event after the media has already started playing String mediaSourceUrl = getStreamingUrl(); long duration = MainActivity.appPlayer.getDuration(); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7124541d..ff560bec 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -245,6 +245,7 @@ Keep the LBRY service running in the background for improved wallet and network performance Participate in the data network (requires app and background service restart) + Send buffering events to LBRY servers %1$s - Search diff --git a/app/src/main/res/xml/settings.xml b/app/src/main/res/xml/settings.xml index 8e9647bf..25af5cb7 100644 --- a/app/src/main/res/xml/settings.xml +++ b/app/src/main/res/xml/settings.xml @@ -64,5 +64,11 @@ app:title="@string/participate_in_data_network" app:iconSpaceReserved="false" app:singleLineTitle="false" /> + \ No newline at end of file