crash fixes

This commit is contained in:
Yuriy Liskov
2025-05-19 10:03:48 +03:00
parent 48cc4a7fcb
commit 11436d8e44
4 changed files with 17 additions and 2 deletions

View File

@@ -60,6 +60,10 @@ public class PlayerUIController extends BasePlayerController {
private long mOverlayHideTimeMs;
private final Runnable mSuggestionsResetHandler = () -> getPlayer().resetSuggestedPosition();
private final Runnable mUiAutoHideHandler = () -> {
if (getPlayer() == null) {
return;
}
// Playing the video and dialog overlay isn't shown
if (getPlayer().isPlaying() && !getAppDialogPresenter().isDialogShown()) {
if (getPlayer().isControlsShown()) { // don't hide when suggestions is shown

View File

@@ -510,6 +510,10 @@ public class VideoStateController extends BasePlayerController {
}
private void restoreSpeedAndPositionIfNeeded() {
if (getPlayer() == null) {
return;
}
Video item = getVideo();
boolean liveEnd = isLiveEnd();

View File

@@ -256,7 +256,13 @@ public final class VideoFrameReleaseTimeHelper {
@Override
public void onDisplayChanged(int displayId) {
if (displayId == Display.DEFAULT_DISPLAY) {
updateDefaultDisplayRefreshRateParams();
// MOD: swallow an exception
try {
updateDefaultDisplayRefreshRateParams();
} catch (IllegalStateException e) {
// IllegalStateException: Unable to locate mode -1
e.printStackTrace();
}
}
}

View File

@@ -347,7 +347,8 @@ public abstract class SearchTagsFragmentBase extends SearchSupportFragment
// speech recognition, and then you can simply call:
try {
SpeechUtil.redirectUserToGoogleAppOnPlayStore(getContext());
} catch (ActivityNotFoundException e) {
} catch (ActivityNotFoundException | NullPointerException e) {
// NullPointerException: android.os.Parcel.readException (Parcel.java:1478)
e.printStackTrace();
}
}