Skip to content

Commit

Permalink
[Many] Bump to min minSdkVersion of 19 across all plugins (#6506)
Browse files Browse the repository at this point in the history
* Bumps any `minSdkVersion`'s below 19 to 19, as the change to only support 19+ has been in stable for a bit now.
* Bumps the minimum required flutter version to 3.16 for the changed packages, as that is the first version in which we started automigrating `minSdkVersion`'s less than 19.
* Also bumps the `minSdkVersion` in the legacy project to `flutter.minSdkVersion`, as this would happen when running an app with `minSdkVersion` < 19.
* Removes some code branches for cases of sdk < 19.
* Fixes some failing tests in `video_player` - for full transparency, I have now idea how these could have been passing before?
  • Loading branch information
gmackall authored Apr 12, 2024
1 parent fc47eb7 commit 6841bb1
Show file tree
Hide file tree
Showing 34 changed files with 87 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .ci/legacy_project/all_packages/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android {

defaultConfig {
applicationId "com.example.all_packages"
minSdkVersion 16
minSdkVersion flutter.minSdkVersion
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
5 changes: 3 additions & 2 deletions packages/espresso/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## NEXT
## 0.3.0+8

* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
* Updates minSdkVersion to 19.
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
* Updates compileSdk version to 34.

## 0.3.0+7
Expand Down
2 changes: 1 addition & 1 deletion packages/espresso/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android {
compileSdk 34

defaultConfig {
minSdkVersion 16
minSdkVersion 19
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand Down
6 changes: 3 additions & 3 deletions packages/espresso/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ description: Java classes for testing Flutter apps using Espresso.
Allows driving Flutter widgets from a native Espresso test.
repository: https://github.com/flutter/packages/tree/main/packages/espresso
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+espresso%22
version: 0.3.0+7
version: 0.3.0+8

environment:
sdk: ^3.1.0
flutter: ">=3.13.0"
sdk: ^3.2.0
flutter: ">=3.16.0"

flutter:
plugin:
Expand Down
5 changes: 5 additions & 0 deletions packages/flutter_plugin_android_lifecycle/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.0.19

* Updates minSdkVersion to 19.
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.

## 2.0.18

* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android {
compileSdk 34

defaultConfig {
minSdkVersion 16
minSdkVersion 19
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'proguard.txt'
}
Expand Down
6 changes: 3 additions & 3 deletions packages/flutter_plugin_android_lifecycle/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: flutter_plugin_android_lifecycle
description: Flutter plugin for accessing an Android Lifecycle within other plugins.
repository: https://github.com/flutter/packages/tree/main/packages/flutter_plugin_android_lifecycle
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_plugin_android_lifecycle%22
version: 2.0.18
version: 2.0.19

environment:
sdk: ^3.1.0
flutter: ">=3.13.0"
sdk: ^3.2.0
flutter: ">=3.16.0"

flutter:
plugin:
Expand Down
5 changes: 5 additions & 0 deletions packages/google_sign_in/google_sign_in_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 6.1.23

* Updates minSdkVersion to 19.
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.

## 6.1.22

* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android {
compileSdk 34

defaultConfig {
minSdkVersion 16
minSdkVersion 19
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand Down
6 changes: 3 additions & 3 deletions packages/google_sign_in/google_sign_in_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: google_sign_in_android
description: Android implementation of the google_sign_in plugin.
repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22
version: 6.1.22
version: 6.1.23

environment:
sdk: ^3.1.0
flutter: ">=3.13.0"
sdk: ^3.2.0
flutter: ">=3.16.0"

flutter:
plugin:
Expand Down
5 changes: 5 additions & 0 deletions packages/image_picker/image_picker_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.8.9+6

* Updates minSdkVersion to 19.
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.

## 0.8.9+5

* Bumps androidx.exifinterface:exifinterface from 1.3.6 to 1.3.7.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android {
compileSdk 34

defaultConfig {
minSdkVersion 16
minSdkVersion 19
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public void chooseMediaFromGallery(

private void launchPickMediaFromGalleryIntent(Messages.GeneralOptions generalOptions) {
Intent pickMediaIntent;
if (generalOptions.getUsePhotoPicker() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (generalOptions.getUsePhotoPicker()) {
if (generalOptions.getAllowMultiple()) {
pickMediaIntent =
new ActivityResultContracts.PickMultipleVisualMedia()
Expand All @@ -320,9 +320,7 @@ private void launchPickMediaFromGalleryIntent(Messages.GeneralOptions generalOpt
pickMediaIntent.setType("*/*");
String[] mimeTypes = {"video/*", "image/*"};
pickMediaIntent.putExtra("CONTENT_TYPE", mimeTypes);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
pickMediaIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, generalOptions.getAllowMultiple());
}
pickMediaIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, generalOptions.getAllowMultiple());
}
activity.startActivityForResult(pickMediaIntent, REQUEST_CODE_CHOOSE_MEDIA_FROM_GALLERY);
}
Expand All @@ -341,7 +339,7 @@ public void chooseVideoFromGallery(

private void launchPickVideoFromGalleryIntent(Boolean usePhotoPicker) {
Intent pickVideoIntent;
if (usePhotoPicker && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (usePhotoPicker) {
pickVideoIntent =
new ActivityResultContracts.PickVisualMedia()
.createIntent(
Expand Down Expand Up @@ -439,7 +437,7 @@ public void chooseMultiImageFromGallery(

private void launchPickImageFromGalleryIntent(Boolean usePhotoPicker) {
Intent pickImageIntent;
if (usePhotoPicker && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (usePhotoPicker) {
pickImageIntent =
new ActivityResultContracts.PickVisualMedia()
.createIntent(
Expand All @@ -456,7 +454,7 @@ private void launchPickImageFromGalleryIntent(Boolean usePhotoPicker) {

private void launchMultiPickImageFromGalleryIntent(Boolean usePhotoPicker) {
Intent pickMultiImageIntent;
if (usePhotoPicker && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (usePhotoPicker) {
pickMultiImageIntent =
new ActivityResultContracts.PickMultipleVisualMedia()
.createIntent(
Expand All @@ -467,9 +465,7 @@ private void launchMultiPickImageFromGalleryIntent(Boolean usePhotoPicker) {
} else {
pickMultiImageIntent = new Intent(Intent.ACTION_GET_CONTENT);
pickMultiImageIntent.setType("image/*");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
pickMultiImageIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
}
pickMultiImageIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
}
activity.startActivityForResult(
pickMultiImageIntent, REQUEST_CODE_CHOOSE_MULTI_IMAGE_FROM_GALLERY);
Expand Down
6 changes: 3 additions & 3 deletions packages/image_picker/image_picker_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: image_picker_android
description: Android implementation of the image_picker plugin.
repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
version: 0.8.9+5
version: 0.8.9+6

environment:
sdk: ^3.1.0
flutter: ">=3.13.0"
sdk: ^3.2.0
flutter: ">=3.16.0"

flutter:
plugin:
Expand Down
5 changes: 5 additions & 0 deletions packages/path_provider/path_provider_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.2.4

* Updates minSdkVersion version to 19.
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.

## 2.2.3

* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android {
compileSdk 34

defaultConfig {
minSdkVersion 16
minSdkVersion 19
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
package io.flutter.plugins.pathprovider;

import android.content.Context;
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand Down Expand Up @@ -110,14 +108,7 @@ private String getPathProviderStorageDirectory() {
private List<String> getPathProviderExternalCacheDirectories() {
final List<String> paths = new ArrayList<>();

if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) {
for (File dir : context.getExternalCacheDirs()) {
if (dir != null) {
paths.add(dir.getAbsolutePath());
}
}
} else {
File dir = context.getExternalCacheDir();
for (File dir : context.getExternalCacheDirs()) {
if (dir != null) {
paths.add(dir.getAbsolutePath());
}
Expand Down Expand Up @@ -159,14 +150,7 @@ private List<String> getPathProviderExternalStorageDirectories(
@NonNull Messages.StorageDirectory directory) {
final List<String> paths = new ArrayList<>();

if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) {
for (File dir : context.getExternalFilesDirs(getStorageDirectoryString(directory))) {
if (dir != null) {
paths.add(dir.getAbsolutePath());
}
}
} else {
File dir = context.getExternalFilesDir(getStorageDirectoryString(directory));
for (File dir : context.getExternalFilesDirs(getStorageDirectoryString(directory))) {
if (dir != null) {
paths.add(dir.getAbsolutePath());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

package io.flutter.plugins.pathprovider;

import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.os.Environment;

/** Helps to map the Dart `StorageDirectory` enum to a Android system constant. */
Expand Down Expand Up @@ -42,11 +40,7 @@ static String androidType(Integer dartIndex) throws IllegalArgumentException {
case 8:
return Environment.DIRECTORY_DCIM;
case 9:
if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) {
return Environment.DIRECTORY_DOCUMENTS;
} else {
throw new IllegalArgumentException("Documents directory is unsupported.");
}
return Environment.DIRECTORY_DOCUMENTS;
default:
throw new IllegalArgumentException("Unknown index: " + dartIndex);
}
Expand Down
6 changes: 3 additions & 3 deletions packages/path_provider/path_provider_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: path_provider_android
description: Android implementation of the path_provider plugin.
repository: https://github.com/flutter/packages/tree/main/packages/path_provider/path_provider_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+path_provider%22
version: 2.2.3
version: 2.2.4

environment:
sdk: ^3.1.0
flutter: ">=3.13.0"
sdk: ^3.2.0
flutter: ">=3.16.0"

flutter:
plugin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ android {
}

defaultConfig {
minSdkVersion 16
minSdkVersion 19
}

testOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ android {
}

defaultConfig {
minSdkVersion 16
minSdkVersion 19
}

testOptions {
Expand Down
5 changes: 3 additions & 2 deletions packages/quick_actions/quick_actions_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## NEXT
## 1.0.11

* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
* Updates minSdkVersion to 19.
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
* Updates compileSdk version to 34.

## 1.0.10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android {
compileSdk 34

defaultConfig {
minSdkVersion 16
minSdkVersion 19
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
Expand Down
6 changes: 3 additions & 3 deletions packages/quick_actions/quick_actions_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: quick_actions_android
description: An implementation for the Android platform of the Flutter `quick_actions` plugin.
repository: https://github.com/flutter/packages/tree/main/packages/quick_actions/quick_actions_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
version: 1.0.10
version: 1.0.11

environment:
sdk: ^3.1.0
flutter: ">=3.13.0"
sdk: ^3.2.0
flutter: ">=3.16.0"

flutter:
plugin:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## NEXT
## 2.2.2

* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
* Updates minSdkVersion to 19.
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
* Updates compileSdk version to 34.
* Updates mockito to 5.2.0.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ android {
}

defaultConfig {
minSdkVersion 16
minSdkVersion 19
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: shared_preferences_android
description: Android implementation of the shared_preferences plugin
repository: https://github.com/flutter/packages/tree/main/packages/shared_preferences/shared_preferences_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+shared_preferences%22
version: 2.2.1
version: 2.2.2

environment:
sdk: ^3.1.0
flutter: ">=3.13.0"
sdk: ^3.2.0
flutter: ">=3.16.0"

flutter:
plugin:
Expand Down
5 changes: 3 additions & 2 deletions packages/url_launcher/url_launcher_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## NEXT
## 6.3.1

* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
* Updates minSdkVersion to 19.
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.

## 6.3.0

Expand Down
Loading

0 comments on commit 6841bb1

Please sign in to comment.