mirror of
https://github.com/yuliskov/SmartTube.git
synced 2026-02-04 13:50:47 -06:00
app: force finish on double back
This commit is contained in:
Submodule MediaServiceCore updated: 96c980de16...9682ac4894
@@ -131,13 +131,12 @@ public class VideoLoaderController extends BasePlayerController {
|
||||
} else if ((!getVideo().isLive || getVideo().isLiveEnd)
|
||||
&& getPlayer().getDurationMs() - getPlayer().getPositionMs() < STREAM_END_THRESHOLD_MS) {
|
||||
getMainController().onPlayEnd();
|
||||
} else if (!getVideo().isLive && !getVideo().isLiveEnd
|
||||
&& !getPlayerTweaksData().isNetworkErrorFixingDisabled() && Playlist.instance().getAllAfterCurrent() == null) {
|
||||
} else if (!getVideo().isLive && !getVideo().isLiveEnd && !getPlayerTweaksData().isNetworkErrorFixingDisabled()) {
|
||||
MessageHelpers.showLongMessage(getContext(), R.string.playback_buffering_fix);
|
||||
YouTubeServiceManager.instance().invalidateCache();
|
||||
// Faster source is different among devices. Try them one by one.
|
||||
switchNextEngine();
|
||||
YouTubeServiceManager.instance().invalidateCache();
|
||||
rebootApp(); // without a reboot the app will keep buffering
|
||||
restartEngine();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ import com.liskovsoft.smartyoutubetv2.common.app.models.playback.controllers.Sug
|
||||
import com.liskovsoft.smartyoutubetv2.common.app.models.playback.controllers.VideoLoaderController;
|
||||
import com.liskovsoft.smartyoutubetv2.common.app.models.playback.controllers.VideoStateController;
|
||||
import com.liskovsoft.smartyoutubetv2.common.app.models.playback.listener.PlayerEventListener;
|
||||
import com.liskovsoft.smartyoutubetv2.common.app.models.playback.listener.PlayerUiEventListener;
|
||||
import com.liskovsoft.smartyoutubetv2.common.app.models.playback.listener.ViewEventListener;
|
||||
import com.liskovsoft.smartyoutubetv2.common.app.presenters.base.BasePresenter;
|
||||
import com.liskovsoft.smartyoutubetv2.common.app.presenters.dialogs.menu.VideoMenuPresenter;
|
||||
|
||||
@@ -875,7 +875,6 @@ public class Utils {
|
||||
*/
|
||||
public static void properlyFinishTheApp(Context context) {
|
||||
ViewManager.instance(context).properlyFinishTheApp(context);
|
||||
//forceFinishTheApp();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -60,8 +60,8 @@ android {
|
||||
applicationId "com.liskovsoft.smarttubetv"
|
||||
minSdkVersion project.properties.minSdkVersion
|
||||
targetSdkVersion project.properties.targetSdkVersion
|
||||
versionCode 2191
|
||||
versionName "30.01"
|
||||
versionCode 2192
|
||||
versionName "30.02"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"
|
||||
|
||||
|
||||
@@ -6,12 +6,12 @@ import android.view.KeyEvent;
|
||||
|
||||
import com.liskovsoft.sharedutils.mylogger.Log;
|
||||
import com.liskovsoft.smartyoutubetv2.common.app.presenters.SearchPresenter;
|
||||
import com.liskovsoft.smartyoutubetv2.common.app.views.ViewManager;
|
||||
import com.liskovsoft.smartyoutubetv2.common.autoframerate.ModeSyncManager;
|
||||
import com.liskovsoft.smartyoutubetv2.common.misc.GlobalKeyTranslator;
|
||||
import com.liskovsoft.smartyoutubetv2.common.misc.MotherActivity;
|
||||
import com.liskovsoft.smartyoutubetv2.common.misc.PlayerKeyTranslator;
|
||||
import com.liskovsoft.smartyoutubetv2.common.prefs.GeneralData;
|
||||
import com.liskovsoft.smartyoutubetv2.common.prefs.RemoteControlData;
|
||||
import com.liskovsoft.smartyoutubetv2.common.utils.Utils;
|
||||
import com.liskovsoft.smartyoutubetv2.tv.ui.common.keyhandler.DoubleBackManager2;
|
||||
import com.liskovsoft.smartyoutubetv2.tv.ui.playback.PlaybackActivity;
|
||||
@@ -137,6 +137,10 @@ public abstract class LeanbackActivity extends MotherActivity {
|
||||
}
|
||||
|
||||
private void finishTheApp() {
|
||||
Utils.properlyFinishTheApp(this);
|
||||
if (RemoteControlData.instance(this).isConnectedBefore()) {
|
||||
Utils.properlyFinishTheApp(this);
|
||||
} else {
|
||||
Utils.forceFinishTheApp();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user