diff --git a/app/build.gradle b/app/build.gradle index be7e80ba..d3fab451 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,8 +14,8 @@ android { applicationId "io.lbry.browser" minSdkVersion 21 targetSdkVersion 29 - versionCode 1516 - versionName "0.15.16" + versionCode 1515 + versionName "0.15.15" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } @@ -96,7 +96,7 @@ dependencies { androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' - __32bitImplementation 'io.lbry:lbrysdk32:0.79.1' - __64bitImplementation 'io.lbry:lbrysdk64:0.79.1' + __32bitImplementation 'io.lbry:lbrysdk32:0.79.0' + __64bitImplementation 'io.lbry:lbrysdk64:0.79.0' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index aee112fa..265c5f40 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -40,13 +40,6 @@ - - - - - - - diff --git a/app/src/main/java/io/lbry/browser/MainActivity.java b/app/src/main/java/io/lbry/browser/MainActivity.java index ec91595d..e86c22c1 100644 --- a/app/src/main/java/io/lbry/browser/MainActivity.java +++ b/app/src/main/java/io/lbry/browser/MainActivity.java @@ -8,7 +8,6 @@ import android.app.NotificationManager; import android.app.PendingIntent; import android.app.PictureInPictureParams; import android.content.BroadcastReceiver; -import android.content.ClipData; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -283,6 +282,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"; @@ -561,7 +561,6 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener protected void onNewIntent(Intent intent) { super.onNewIntent(intent); - checkSendToIntent(intent); checkUrlIntent(intent); checkNotificationOpenIntent(intent); } @@ -816,12 +815,6 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener openFragment(FileViewFragment.class, true, NavMenuItem.ID_ITEM_FOLLOWING, params); } - public void openSendTo(String path) { - Map params = new HashMap<>(); - params.put("directFilePath", path); - openFragment(PublishFormFragment.class, true, NavMenuItem.ID_ITEM_NEW_PUBLISH, params); - } - public void openFileClaim(Claim claim) { Map params = new HashMap<>(); params.put("claimId", claim.getClaimId()); @@ -1784,11 +1777,11 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(MainActivity.this); sp.edit().putBoolean(PREFERENCE_KEY_INTERNAL_INITIAL_SUBSCRIPTION_MERGE_DONE, true).apply(); - Lbryio.cacheResolvedSubscriptions.clear(); for (Fragment fragment : openNavFragments.values()) { if (fragment instanceof FollowingFragment) { // reload local subscriptions + Lbryio.cacheResolvedSubscriptions.clear(); FollowingFragment followingFragment = (FollowingFragment) fragment; followingFragment.fetchLoadedSubscriptions(true); } @@ -2633,19 +2626,6 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener LbryAnalytics.logEvent(LbryAnalytics.EVENT_LBRY_NOTIFICATION_OPEN, bundle); } - private void checkSendToIntent(Intent intent) { - String intentAction = intent.getAction(); - if (intentAction != null && intentAction.equals("android.intent.action.SEND")) { - ClipData clipData = intent.getClipData(); - if (clipData != null) { - Uri uri = clipData.getItemAt(0).getUri(); - - String path = Helper.getRealPathFromURI_API19(this, uri); - openSendTo(path); - } - } - } - private void registerServiceActionsReceiver() { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(DownloadManager.ACTION_DOWNLOAD_EVENT); diff --git a/app/src/main/java/io/lbry/browser/ui/findcontent/FileViewFragment.java b/app/src/main/java/io/lbry/browser/ui/findcontent/FileViewFragment.java index 9adec2d7..18b0ba62 100644 --- a/app/src/main/java/io/lbry/browser/ui/findcontent/FileViewFragment.java +++ b/app/src/main/java/io/lbry/browser/ui/findcontent/FileViewFragment.java @@ -294,7 +294,15 @@ public class FileViewFragment extends BaseFragment implements loadingNewClaim = false; } } else if (playbackState == Player.STATE_BUFFERING) { - if (MainActivity.appPlayer != null && MainActivity.appPlayer.getCurrentPosition() > 0) { + Context ctx = getContext(); + boolean sendBufferingEvents = false; + + if (ctx != null) { + SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(ctx); + sendBufferingEvents = sp.getBoolean(MainActivity.PREFERENCE_KEY_SEND_BUFFERING_EVENTS, false); + } + + 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 8d11777f..2f61dfce 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 c54f18e5..68478c56 100644 --- a/app/src/main/res/xml/settings.xml +++ b/app/src/main/res/xml/settings.xml @@ -58,5 +58,10 @@ app:title="@string/participate_in_data_network" app:iconSpaceReserved="false" app:singleLineTitle="false" /> + \ No newline at end of file