Drop Android 4.2 support

Resolves #6276

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2020-06-12 10:01:52 +02:00
parent 228a44fc87
commit adac921f5c
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
6 changed files with 29 additions and 50 deletions

View file

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

View file

@ -473,12 +473,10 @@ public class MainApp extends MultiDexApplication implements HasAndroidInjector {
connectivityService,
powerManagementService);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
ReceiversHelper.registerPowerChangeReceiver(uploadsStorageManager,
accountManager,
connectivityService,
powerManagementService);
}
ReceiversHelper.registerPowerChangeReceiver(uploadsStorageManager,
accountManager,
connectivityService,
powerManagementService);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
ReceiversHelper.registerPowerSaveReceiver(uploadsStorageManager,

View file

@ -449,11 +449,8 @@ public class ActivityListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
return DisplayUtils.getRelativeDateTimeString(context, modificationTimestamp, DateUtils.DAY_IN_MILLIS,
DateUtils.WEEK_IN_MILLIS, 0);
} else {
String pattern = "EEEE, MMMM d";
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2) {
pattern = DateFormat.getBestDateTimePattern(Locale.getDefault(), "EEEE, MMMM d");
}
return DateFormat.format(pattern, modificationTimestamp);
return DateFormat.format(DateFormat.getBestDateTimePattern(
Locale.getDefault(), "EEEE, MMMM d"), modificationTimestamp);
}
}

View file

@ -230,9 +230,8 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
}
mUploadOnWifiCheckbox.setChecked(mSyncedFolder.isWifiOnly());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
mUploadOnChargingCheckbox.setChecked(mSyncedFolder.isChargingOnly());
}
mUploadOnChargingCheckbox.setChecked(mSyncedFolder.isChargingOnly());
mUploadExistingCheckbox.setChecked(mSyncedFolder.isExisting());
mUploadUseSubfoldersCheckbox.setChecked(mSyncedFolder.isSubfolderByDate());
@ -330,10 +329,8 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
view.findViewById(R.id.setting_instant_upload_on_wifi_container).setEnabled(enable);
view.findViewById(R.id.setting_instant_upload_on_wifi_container).setAlpha(alpha);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
view.findViewById(R.id.setting_instant_upload_on_charging_container).setEnabled(enable);
view.findViewById(R.id.setting_instant_upload_on_charging_container).setAlpha(alpha);
}
view.findViewById(R.id.setting_instant_upload_on_charging_container).setEnabled(enable);
view.findViewById(R.id.setting_instant_upload_on_charging_container).setAlpha(alpha);
view.findViewById(R.id.setting_instant_upload_existing_container).setEnabled(enable);
view.findViewById(R.id.setting_instant_upload_existing_container).setAlpha(alpha);
@ -377,25 +374,22 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
view.findViewById(R.id.delete).setOnClickListener(new OnSyncedFolderDeleteClickListener());
view.findViewById(R.id.setting_instant_upload_on_wifi_container).setOnClickListener(
new OnClickListener() {
@Override
public void onClick(View v) {
mSyncedFolder.setWifiOnly(!mSyncedFolder.isWifiOnly());
mUploadOnWifiCheckbox.toggle();
}
});
new OnClickListener() {
@Override
public void onClick(View v) {
mSyncedFolder.setWifiOnly(!mSyncedFolder.isWifiOnly());
mUploadOnWifiCheckbox.toggle();
}
});
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
view.findViewById(R.id.setting_instant_upload_on_charging_container).setOnClickListener(
new OnClickListener() {
@Override
public void onClick(View v) {
mSyncedFolder.setChargingOnly(!mSyncedFolder.isChargingOnly());
mUploadOnChargingCheckbox.toggle();
}
});
}
view.findViewById(R.id.setting_instant_upload_on_charging_container).setOnClickListener(
new OnClickListener() {
@Override
public void onClick(View v) {
mSyncedFolder.setChargingOnly(!mSyncedFolder.isChargingOnly());
mUploadOnChargingCheckbox.toggle();
}
});
view.findViewById(R.id.setting_instant_upload_existing_container).setOnClickListener(
new OnClickListener() {

View file

@ -428,10 +428,8 @@ public class OCFileListFragment extends ExtendedListFragment implements
public void uploadFromApp() {
Intent action = new Intent(Intent.ACTION_GET_CONTENT);
action = action.setType("*/*").addCategory(Intent.CATEGORY_OPENABLE);
//Intent.EXTRA_ALLOW_MULTIPLE is only supported on api level 18+, Jelly Bean
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
action.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
}
action.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
getActivity().startActivityForResult(
Intent.createChooser(action, getString(R.string.upload_chooser_title)),
FileDisplayActivity.REQUEST_CODE__SELECT_CONTENT_FROM_APPS

View file

@ -1057,14 +1057,6 @@ public class FileOperationsHelper {
return -1L;
}
long availableBytesOnDevice;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2) {
availableBytesOnDevice = stat.getBlockSizeLong() * stat.getAvailableBlocksLong();
} else {
availableBytesOnDevice = (long) stat.getBlockSize() * (long) stat.getAvailableBlocks();
}
return availableBytesOnDevice;
return stat.getBlockSizeLong() * stat.getAvailableBlocksLong();
}
}