Drop Android 5.0 support
Resolves #8508 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
2dd46ea967
commit
4fd407bc11
|
@ -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)
|
## 3.16.1 (June, 01, 2021)
|
||||||
|
|
||||||
- Fix media tab not showing images/videos
|
- Fix media tab not showing images/videos
|
||||||
|
|
|
@ -126,7 +126,7 @@ android {
|
||||||
compileSdkVersion 29
|
compileSdkVersion 29
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 21
|
minSdkVersion 22
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
|
|
||||||
// arguments to be passed to functional tests
|
// arguments to be passed to functional tests
|
||||||
|
|
|
@ -34,8 +34,4 @@ class DeviceInfo {
|
||||||
fun hasCamera(context: Context): Boolean {
|
fun hasCamera(context: Context): Boolean {
|
||||||
return context.packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY)
|
return context.packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun editorSupported(): Boolean {
|
|
||||||
return apiLevel < Build.VERSION_CODES.LOLLIPOP
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,12 +60,7 @@ internal class PowerManagementServiceImpl(
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
return platformPowerManager.isPowerSaveMode
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override val isPowerSavingExclusionAvailable: Boolean
|
override val isPowerSavingExclusionAvailable: Boolean
|
||||||
|
@ -80,8 +75,7 @@ internal class PowerManagementServiceImpl(
|
||||||
when {
|
when {
|
||||||
plugged == BatteryManager.BATTERY_PLUGGED_USB -> true
|
plugged == BatteryManager.BATTERY_PLUGGED_USB -> true
|
||||||
plugged == BatteryManager.BATTERY_PLUGGED_AC -> 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
|
else -> false
|
||||||
}
|
}
|
||||||
} ?: false
|
} ?: false
|
||||||
|
|
|
@ -282,7 +282,7 @@ public class FileMenuFilter {
|
||||||
List<Integer> toHide,
|
List<Integer> toHide,
|
||||||
OCCapability capability
|
OCCapability capability
|
||||||
) {
|
) {
|
||||||
if (deviceInfo.editorSupported() || files.iterator().next().isEncrypted()) {
|
if (files.iterator().next().isEncrypted()) {
|
||||||
toHide.add(R.id.action_edit);
|
toHide.add(R.id.action_edit);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,14 +34,13 @@ import com.owncloud.android.files.FileMenuFilter
|
||||||
import com.owncloud.android.ui.asynctasks.TextEditorLoadUrlTask
|
import com.owncloud.android.ui.asynctasks.TextEditorLoadUrlTask
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
|
||||||
class TextEditorWebView : EditorWebView() {
|
class TextEditorWebView : EditorWebView() {
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var appInfo: AppInfo
|
lateinit var appInfo: AppInfo
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var deviceInfo: DeviceInfo
|
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?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
|
|
@ -83,9 +83,9 @@ class TestPowerManagementService {
|
||||||
@Test
|
@Test
|
||||||
fun `power saving queries power manager on API 21+`() {
|
fun `power saving queries power manager on API 21+`() {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
// API level >= 21
|
// API level >= 22 (since 22+ is supported)
|
||||||
// power save mode is on
|
// 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)
|
whenever(platformPowerManager.isPowerSaveMode).thenReturn(true)
|
||||||
|
|
||||||
// WHEN
|
// WHEN
|
||||||
|
@ -97,22 +97,6 @@ class TestPowerManagementService {
|
||||||
verify(platformPowerManager).isPowerSaveMode
|
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
|
@Test
|
||||||
fun `power saving exclusion is available for flagged vendors`() {
|
fun `power saving exclusion is available for flagged vendors`() {
|
||||||
for (vendor in PowerManagementServiceImpl.OVERLY_AGGRESSIVE_POWER_SAVING_VENDORS) {
|
for (vendor in PowerManagementServiceImpl.OVERLY_AGGRESSIVE_POWER_SAVING_VENDORS) {
|
||||||
|
|
Loading…
Reference in New Issue