AndroidManifest.xml: require Android 7.0 (Nougat)

This commit is contained in:
Andreas Schildbach 2024-06-12 19:14:36 +02:00
parent b1e17c5795
commit 4a17ef441f
5 changed files with 2 additions and 22 deletions

View file

@ -24,7 +24,7 @@
android:versionName="12.1.21"> android:versionName="12.1.21">
<uses-sdk <uses-sdk
android:minSdkVersion="21" android:minSdkVersion="24"
android:targetSdkVersion="34" /> android:targetSdkVersion="34" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />

View file

@ -17,12 +17,10 @@
package de.schildbach.oeffi; package de.schildbach.oeffi;
import android.annotation.TargetApi;
import android.app.ActivityManager.TaskDescription; import android.app.ActivityManager.TaskDescription;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.text.format.DateUtils; import android.text.format.DateUtils;
@ -152,10 +150,4 @@ public abstract class OeffiActivity extends ComponentActivity {
return str; return str;
} }
@TargetApi(24)
@Override
public boolean isInMultiWindowMode() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && super.isInMultiWindowMode();
}
} }

View file

@ -18,7 +18,6 @@
package de.schildbach.oeffi.network; package de.schildbach.oeffi.network;
import android.Manifest; import android.Manifest;
import android.annotation.TargetApi;
import android.app.ActivityManager.TaskDescription; import android.app.ActivityManager.TaskDescription;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
@ -29,7 +28,6 @@ import android.content.res.Resources;
import android.location.Address; import android.location.Address;
import android.location.Criteria; import android.location.Criteria;
import android.location.LocationManager; import android.location.LocationManager;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.HandlerThread; import android.os.HandlerThread;
@ -571,10 +569,4 @@ public class NetworkPickerActivity extends ComponentActivity implements Location
actionBar.setBackgroundColor(color); actionBar.setBackgroundColor(color);
setTaskDescription(new TaskDescription(null, null, color)); setTaskDescription(new TaskDescription(null, null, color));
} }
@TargetApi(24)
@Override
public boolean isInMultiWindowMode() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && super.isInMultiWindowMode();
}
} }

View file

@ -17,7 +17,6 @@
package de.schildbach.oeffi.preference; package de.schildbach.oeffi.preference;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceFragment; import android.preference.PreferenceFragment;
import de.schildbach.oeffi.R; import de.schildbach.oeffi.R;
@ -25,13 +24,11 @@ import de.schildbach.oeffi.R;
import javax.annotation.Nullable; import javax.annotation.Nullable;
public class CommonFragment extends PreferenceFragment { public class CommonFragment extends PreferenceFragment {
private static final String KEY_BATTERY_OPTIMIZATIONS = "battery_optimizations";
@Override @Override
public void onCreate(@Nullable Bundle savedInstanceState) { public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preference_common); addPreferencesFromResource(R.xml.preference_common);
findPreference(KEY_BATTERY_OPTIMIZATIONS).setEnabled(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M);
} }
} }

View file

@ -181,8 +181,7 @@ public class ErrorReporter implements Thread.UncaughtExceptionHandler {
report.append("Manufacturer: " + Build.MANUFACTURER + "\n"); report.append("Manufacturer: " + Build.MANUFACTURER + "\n");
report.append("Phone Model: " + Build.MODEL + "\n"); report.append("Phone Model: " + Build.MODEL + "\n");
report.append("Android Version: " + Build.VERSION.RELEASE + "\n"); report.append("Android Version: " + Build.VERSION.RELEASE + "\n");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) report.append("Android security patch level: ").append(Build.VERSION.SECURITY_PATCH).append("\n");
report.append("Android security patch level: ").append(Build.VERSION.SECURITY_PATCH).append("\n");
report.append("ABIs: ").append(Joiner.on(", ").skipNulls().join(Strings.emptyToNull(Build.CPU_ABI), report.append("ABIs: ").append(Joiner.on(", ").skipNulls().join(Strings.emptyToNull(Build.CPU_ABI),
Strings.emptyToNull(Build.CPU_ABI2))).append("\n"); Strings.emptyToNull(Build.CPU_ABI2))).append("\n");
report.append("Board: " + Build.BOARD + "\n"); report.append("Board: " + Build.BOARD + "\n");