Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

fix(YouTube - Hide ads): Do not show error toast and hide full screen ads #569

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@SuppressWarnings("unused")
public final class AdsFilter extends Filter {
// region Fullscreen ad
private static long lastTimeClosedFullscreenAd = 0;
private static volatile long lastTimeClosedFullscreenAd;
private static final Instrumentation instrumentation = new Instrumentation();
private final StringFilterGroup fullscreenAd;

Expand Down Expand Up @@ -168,6 +168,9 @@ private static void closeFullscreenAd() {

Logger.printDebug(() -> "Closing fullscreen ad");

Utils.runOnMainThreadDelayed(() -> instrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK), 1000);
Utils.runOnMainThreadDelayed(() -> {
// Must run off main thread (Odd, but whatever).
Utils.runOnBackgroundThread(() -> instrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK));
oSumAtrIX marked this conversation as resolved.
Show resolved Hide resolved
}, 1000);
}
}
Loading