Drop Android 5.0 support

Resolves #8508

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2021-06-01 16:53:50 +02:00
parent 2dd46ea967
commit 4fd407bc11
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B
7 changed files with 16 additions and 34 deletions

View File

@ -1,3 +1,12 @@
## 3.17.0 (-, -, -)
- New upload manager @ezaquarii
- UI improvements
Minimum: NC 16 Server, Android 5.0 Lollipop
For a full list, please see https://github.com/nextcloud/android/milestone/59
## 3.16.1 (June, 01, 2021)
- Fix media tab not showing images/videos

View File

@ -126,7 +126,7 @@ android {
compileSdkVersion 29
defaultConfig {
minSdkVersion 21
minSdkVersion 22
targetSdkVersion 29
// arguments to be passed to functional tests

View File

@ -34,8 +34,4 @@ class DeviceInfo {
fun hasCamera(context: Context): Boolean {
return context.packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY)
}
fun editorSupported(): Boolean {
return apiLevel < Build.VERSION_CODES.LOLLIPOP
}
}

View File

@ -60,12 +60,7 @@ internal class PowerManagementServiceImpl(
return false
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
if (deviceInfo.apiLevel >= Build.VERSION_CODES.LOLLIPOP) {
return platformPowerManager.isPowerSaveMode
}
// For older versions, we just say that device is not in power save mode
return false
return platformPowerManager.isPowerSaveMode
}
override val isPowerSavingExclusionAvailable: Boolean
@ -80,8 +75,7 @@ internal class PowerManagementServiceImpl(
when {
plugged == BatteryManager.BATTERY_PLUGGED_USB -> true
plugged == BatteryManager.BATTERY_PLUGGED_AC -> true
deviceInfo.apiLevel >= Build.VERSION_CODES.JELLY_BEAN_MR1 &&
plugged == BatteryManager.BATTERY_PLUGGED_WIRELESS -> true
plugged == BatteryManager.BATTERY_PLUGGED_WIRELESS -> true
else -> false
}
} ?: false

View File

@ -282,7 +282,7 @@ public class FileMenuFilter {
List<Integer> toHide,
OCCapability capability
) {
if (deviceInfo.editorSupported() || files.iterator().next().isEncrypted()) {
if (files.iterator().next().isEncrypted()) {
toHide.add(R.id.action_edit);
return;
}

View File

@ -34,14 +34,13 @@ import com.owncloud.android.files.FileMenuFilter
import com.owncloud.android.ui.asynctasks.TextEditorLoadUrlTask
import javax.inject.Inject
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
class TextEditorWebView : EditorWebView() {
@Inject
lateinit var appInfo: AppInfo
@Inject
lateinit var deviceInfo: DeviceInfo
@SuppressLint("AddJavascriptInterface") // suppress warning as webview is only used >= Lollipop
@SuppressLint("AddJavascriptInterface") // suppress warning as webview is only used > Lollipop
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

View File

@ -83,9 +83,9 @@ class TestPowerManagementService {
@Test
fun `power saving queries power manager on API 21+`() {
// GIVEN
// API level >= 21
// API level >= 22 (since 22+ is supported)
// power save mode is on
whenever(deviceInfo.apiLevel).thenReturn(Build.VERSION_CODES.LOLLIPOP)
whenever(deviceInfo.apiLevel).thenReturn(Build.VERSION_CODES.LOLLIPOP_MR1)
whenever(platformPowerManager.isPowerSaveMode).thenReturn(true)
// WHEN
@ -97,22 +97,6 @@ class TestPowerManagementService {
verify(platformPowerManager).isPowerSaveMode
}
@Test
fun `power saving is not available below API 21`() {
// GIVEN
// API level <21
whenever(deviceInfo.apiLevel).thenReturn(Build.VERSION_CODES.KITKAT)
// WHEN
// power save mode is checked
// THEN
// power save mode is disabled
// power manager is not queried
assertFalse(powerManagementService.isPowerSavingEnabled)
verify(platformPowerManager, never()).isPowerSaveMode
}
@Test
fun `power saving exclusion is available for flagged vendors`() {
for (vendor in PowerManagementServiceImpl.OVERLY_AGGRESSIVE_POWER_SAVING_VENDORS) {