@@ -36,20 +36,32 @@ public final class DeviceUtils {
3636 private static Boolean isTV = null ;
3737 private static Boolean isFireTV = null ;
3838
39+ /**
40+ * <p>The app version code that corresponds to the last update
41+ * of the media tunneling device blacklist.</p>
42+ * <p>The value of this variable needs to be updated everytime a new device that does not
43+ * support media tunneling to match the <strong>upcoming</strong> version code.</p>
44+ * @see #shouldSupportMediaTunneling()
45+ */
46+ public static final int MEDIA_TUNNELING_DEVICE_BLACKLIST_VERSION = 994 ;
3947
40- // region: devices not supporting media tunneling
48+ // region: devices not supporting media tunneling / media tunneling blacklist
4149 /**
42- * Formuler Z8 Pro, Z8, CC, Z Alpha, Z+ Neo.
50+ * <p>Formuler Z8 Pro, Z8, CC, Z Alpha, Z+ Neo.</p>
51+ * <p>Blacklist reason: black screen</p>
52+ * <p>Board: HiSilicon Hi3798MV200</p>
4353 */
4454 private static final boolean HI3798MV200 = Build .VERSION .SDK_INT == 24
4555 && Build .DEVICE .equals ("Hi3798MV200" );
4656 /**
47- * Zephir TS43UHD-2.
57+ * <p>Zephir TS43UHD-2.</p>
58+ * <p>Blacklist reason: black screen</p>
4859 */
4960 private static final boolean CVT_MT5886_EU_1G = Build .VERSION .SDK_INT == 24
5061 && Build .DEVICE .equals ("cvt_mt5886_eu_1g" );
5162 /**
5263 * Hilife TV.
64+ * <p>Blacklist reason: black screen</p>
5365 */
5466 private static final boolean REALTEKATV = Build .VERSION .SDK_INT == 25
5567 && Build .DEVICE .equals ("RealtekATV" );
@@ -60,19 +72,23 @@ public final class DeviceUtils {
6072 private static final boolean PH7M_EU_5596 = Build .VERSION .SDK_INT >= 26
6173 && Build .DEVICE .equals ("PH7M_EU_5596" );
6274 /**
63- * Philips QM16XE.
75+ * <p>Philips QM16XE.</p>
76+ * <p>Blacklist reason: black screen</p>
6477 */
6578 private static final boolean QM16XE_U = Build .VERSION .SDK_INT == 23
6679 && Build .DEVICE .equals ("QM16XE_U" );
6780 /**
6881 * <p>Sony Bravia VH1.</p>
69- * Processor: MT5895
82+ * <p>Processor: MT5895</p>
83+ * <p>Blacklist reason: fullscreen crash / stuttering</p>
7084 */
7185 private static final boolean BRAVIA_VH1 = Build .VERSION .SDK_INT == 29
7286 && Build .DEVICE .equals ("BRAVIA_VH1" );
7387 /**
7488 * <p>Sony Bravia VH2.</p>
75- * This includes model A90J.
89+ * <p>Blacklist reason: fullscreen crash; this includes model A90J as reported in
90+ * <a href="https://github.com/TeamNewPipe/NewPipe/issues/9023#issuecomment-1387106242">
91+ * #9023</a></p>
7692 */
7793 private static final boolean BRAVIA_VH2 = Build .VERSION .SDK_INT == 29
7894 && Build .DEVICE .equals ("BRAVIA_VH2" );
@@ -85,18 +101,22 @@ public final class DeviceUtils {
85101 private static final boolean BRAVIA_ATV2 = Build .DEVICE .equals ("BRAVIA_ATV2" );
86102 /**
87103 * <p>Sony Bravia Android TV platform 3 4K.</p>
88- * Uses ARM MT5891 and a {@link #BRAVIA_ATV2} motherboard.
104+ * <p>Uses ARM MT5891 and a {@link #BRAVIA_ATV2} motherboard.</p>
105+ *
89106 * @see <a href="https://browser.geekbench.com/v4/cpu/9101105">
90107 * https://browser.geekbench.com/v4/cpu/9101105</a>
91108 */
92109 private static final boolean BRAVIA_ATV3_4K = Build .DEVICE .equals ("BRAVIA_ATV3_4K" );
93110 /**
94- * Panasonic 4KTV-JUP.
111+ * <p>Panasonic 4KTV-JUP.</p>
112+ * <p>Blacklist reason: fullscreen crash</p>
95113 */
96114 private static final boolean TX_50JXW834 = Build .DEVICE .equals ("TX_50JXW834" );
97115 /**
98116 * <p>Bouygtel4K / Bouygues Telecom Bbox 4K.</p>
99- * Reported at https://github.com/TeamNewPipe/NewPipe/pull/10122#issuecomment-1638475769
117+ * <p>Blacklist reason: black screen; reported at
118+ * <a href="https://github.com/TeamNewPipe/NewPipe/pull/10122#issuecomment-1638475769">
119+ * #10122</a></p>
100120 */
101121 private static final boolean HMB9213NW = Build .DEVICE .equals ("HMB9213NW" );
102122 // endregion
@@ -292,24 +312,27 @@ public static int getWindowHeight(@NonNull final WindowManager windowManager) {
292312
293313 /**
294314 * <p>Some devices have broken tunneled video playback but claim to support it.</p>
295- * See https://github.com/TeamNewPipe/NewPipe/issues/5911
296- * @Note Add a new {@link org.schabi.newpipe.settings.SettingMigrations.Migration} which calls
297- * {@link org.schabi.newpipe.settings.NewPipeSettings#setMediaTunneling(Context)}
315+ * <p>This can cause a black video player surface while attempting to play a video or
316+ * crashes while entering or exiting the full screen player.
317+ * The issue effects Android TVs most commonly.
318+ * See <a href="https://github.com/TeamNewPipe/NewPipe/issues/5911">#5911</a> and
319+ * <a href="https://github.com/TeamNewPipe/NewPipe/issues/9023">#9023</a> for more info.</p>
320+ * @Note Update {@link #MEDIA_TUNNELING_DEVICE_BLACKLIST_VERSION}
298321 * when adding a new device to the method.
299322 * @return {@code false} if affected device; {@code true} otherwise
300323 */
301324 public static boolean shouldSupportMediaTunneling () {
302- // Maintainers note: add a new SettingsMigration which calls
325+ // Maintainers note: update MEDIA_TUNNELING_DEVICES_UPDATE_APP_VERSION_CODE
303326 return !HI3798MV200
304327 && !CVT_MT5886_EU_1G
305328 && !REALTEKATV
306329 && !QM16XE_U
307330 && !BRAVIA_VH1
308331 && !BRAVIA_VH2
309- && !BRAVIA_ATV2 // crash caused by exiting full screen
310- && !BRAVIA_ATV3_4K // crash caused by exiting full screen
332+ && !BRAVIA_ATV2
333+ && !BRAVIA_ATV3_4K
311334 && !PH7M_EU_5596
312335 && !TX_50JXW834
313- && !HMB9213NW ; // crash caused by exiting full screen
336+ && !HMB9213NW ;
314337 }
315338}
0 commit comments