1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2026-04-22 14:51:23 +00:00

Use final where possible

This commit is contained in:
wb9688
2020-08-16 10:24:58 +02:00
parent d306513319
commit 87228673b4
132 changed files with 1024 additions and 1005 deletions

View File

@@ -27,7 +27,7 @@ public final class DeviceUtils {
return isTV;
}
PackageManager pm = App.getApp().getPackageManager();
final PackageManager pm = App.getApp().getPackageManager();
// from doc: https://developer.android.com/training/tv/start/hardware.html#runtime-check
boolean isTv = ((UiModeManager) context.getSystemService(UI_MODE_SERVICE))
@@ -37,7 +37,8 @@ public final class DeviceUtils {
// from https://stackoverflow.com/a/58932366
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
boolean isBatteryAbsent = ((BatteryManager) context.getSystemService(BATTERY_SERVICE))
final boolean isBatteryAbsent
= ((BatteryManager) context.getSystemService(BATTERY_SERVICE))
.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY) == 0;
isTv = isTv || (isBatteryAbsent
&& !pm.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN)