Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packages/camera/camera_android/example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ allprojects {
google()
mavenCentral()
}
// Build the plugin project with warnings enabled. This is here rather than
// in the plugin itself to avoid breaking clients that have different
// warnings (e.g., deprecation warnings from a newer SDK than this project
// builds with).
gradle.projectsEvaluated {
project(":camera_android") {
tasks.withType(JavaCompile) {
// TODO(stuartmorgan): Enable this. See
// https://github.com/flutter/flutter/issues/91868
//options.compilerArgs << "-Xlint:all" << "-Werror"
}
}
}
}

rootProject.buildDir = '../build'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ public Long bindToLifecycle(
instanceManager.getInstance(((Number) useCaseIds.get(i)).longValue()));
}

Camera camera =
processCameraProvider.bindToLifecycle(
(LifecycleOwner) lifecycleOwner, cameraSelector, useCases);
Camera camera = processCameraProvider.bindToLifecycle(lifecycleOwner, cameraSelector, useCases);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes an unnecessary cast warning.


final CameraFlutterApiImpl cameraFlutterApi =
new CameraFlutterApiImpl(binaryMessenger, instanceManager);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ allprojects {
google()
mavenCentral()
}
// Build the plugin project with warnings enabled. This is here rather than
// in the plugin itself to avoid breaking clients that have different
// warnings (e.g., deprecation warnings from a newer SDK than this project
// builds with).
gradle.projectsEvaluated {
project(":camera_android_camerax") {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all" << "-Werror"
}
}
}
}

rootProject.buildDir = '../build'
Expand Down
13 changes: 13 additions & 0 deletions packages/espresso/example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ allprojects {
google()
mavenCentral()
}
// Build the plugin project with warnings enabled. This is here rather than
// in the plugin itself to avoid breaking clients that have different
// warnings (e.g., deprecation warnings from a newer SDK than this project
// builds with).
gradle.projectsEvaluated {
project(":espresso") {
tasks.withType(JavaCompile) {
// TODO(stuartmorgan): Enable this. See
// https://github.com/flutter/flutter/issues/91868
//options.compilerArgs << "-Xlint:all" << "-Werror"
}
}
}
}

rootProject.buildDir = '../build'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ allprojects {
google()
mavenCentral()
}
// Build the plugin project with warnings enabled. This is here rather than
// in the plugin itself to avoid breaking clients that have different
// warnings (e.g., deprecation warnings from a newer SDK than this project
// builds with).
gradle.projectsEvaluated {
project(":flutter_plugin_android_lifecycle") {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all" << "-Werror"
}
}
}
}

rootProject.buildDir = '../build'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.4.7

* Fixes compilation warnings.

## 2.4.6

* Updates links for the merge of flutter/plugins into flutter/packages.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.google.android.gms.maps.model.RoundCap;
import com.google.android.gms.maps.model.SquareCap;
import com.google.android.gms.maps.model.Tile;
import io.flutter.view.FlutterMain;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick research suggested that there's no good way to suppress the deprecation warning this line creates, so I fully qualified the names instead.

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
Expand All @@ -50,15 +49,16 @@ private static BitmapDescriptor toBitmapDescriptor(Object o) {
case "fromAsset":
if (data.size() == 2) {
return BitmapDescriptorFactory.fromAsset(
FlutterMain.getLookupKeyForAsset(toString(data.get(1))));
io.flutter.view.FlutterMain.getLookupKeyForAsset(toString(data.get(1))));
} else {
return BitmapDescriptorFactory.fromAsset(
FlutterMain.getLookupKeyForAsset(toString(data.get(1)), toString(data.get(2))));
io.flutter.view.FlutterMain.getLookupKeyForAsset(
toString(data.get(1)), toString(data.get(2))));
}
case "fromAssetImage":
if (data.size() == 3) {
return BitmapDescriptorFactory.fromAsset(
FlutterMain.getLookupKeyForAsset(toString(data.get(1))));
io.flutter.view.FlutterMain.getLookupKeyForAsset(toString(data.get(1))));
} else {
throw new IllegalArgumentException(
"'fromAssetImage' Expected exactly 3 arguments, got: " + data.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ allprojects {
google()
mavenCentral()
}
// Build the plugin project with warnings enabled. This is here rather than
// in the plugin itself to avoid breaking clients that have different
// warnings (e.g., deprecation warnings from a newer SDK than this project
// builds with).
gradle.projectsEvaluated {
project(":google_maps_flutter_android") {
tasks.withType(JavaCompile) {
// TODO(stuartmorgan): Enable this. See
// https://github.com/flutter/flutter/issues/91868
//options.compilerArgs << "-Xlint:all" << "-Werror"
}
}
}
}

rootProject.buildDir = '../build'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: google_maps_flutter_android
description: Android implementation of the google_maps_flutter plugin.
repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
version: 2.4.6
version: 2.4.7

environment:
sdk: ">=2.14.0 <3.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ allprojects {
google()
mavenCentral()
}
// Build the plugin project with warnings enabled. This is here rather than
// in the plugin itself to avoid breaking clients that have different
// warnings (e.g., deprecation warnings from a newer SDK than this project
// builds with).
gradle.projectsEvaluated {
project(":google_sign_in_android") {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all" << "-Werror"
}
}
}
}

rootProject.buildDir = '../build'
Expand Down
4 changes: 4 additions & 0 deletions packages/image_picker/image_picker_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.8.5+8

* Fixes compilation warnings.

## 0.8.5+7

* Updates links for the merge of flutter/plugins into flutter/packages.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@
import java.util.Map;
import java.util.UUID;

enum CameraDevice {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes a warning about referencing a class other that the main class (I forget the actual term in the warning) from another file.

REAR,

FRONT
}

/**
* A delegate class doing the heavy lifting for the plugin.
*
Expand Down Expand Up @@ -83,6 +77,11 @@ public class ImagePickerDelegate
@VisibleForTesting static final int REQUEST_CODE_TAKE_VIDEO_WITH_CAMERA = 2353;
@VisibleForTesting static final int REQUEST_CAMERA_VIDEO_PERMISSION = 2355;

public enum CameraDevice {
REAR,
FRONT
}

@VisibleForTesting final String fileProviderName;

private final Activity activity;
Expand Down Expand Up @@ -219,21 +218,22 @@ void saveStateBeforeResult() {
void retrieveLostImage(MethodChannel.Result result) {
Map<String, Object> resultMap = cache.getCacheMap();
@SuppressWarnings("unchecked")
ArrayList<String> pathList = (ArrayList<String>) resultMap.get(cache.MAP_KEY_PATH_LIST);
ArrayList<String> pathList =
(ArrayList<String>) resultMap.get(ImagePickerCache.MAP_KEY_PATH_LIST);
ArrayList<String> newPathList = new ArrayList<>();
if (pathList != null) {
for (String path : pathList) {
Double maxWidth = (Double) resultMap.get(cache.MAP_KEY_MAX_WIDTH);
Double maxHeight = (Double) resultMap.get(cache.MAP_KEY_MAX_HEIGHT);
Double maxWidth = (Double) resultMap.get(ImagePickerCache.MAP_KEY_MAX_WIDTH);
Double maxHeight = (Double) resultMap.get(ImagePickerCache.MAP_KEY_MAX_HEIGHT);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes a warning about referencing static constants via instance.

int imageQuality =
resultMap.get(cache.MAP_KEY_IMAGE_QUALITY) == null
resultMap.get(ImagePickerCache.MAP_KEY_IMAGE_QUALITY) == null
? 100
: (int) resultMap.get(cache.MAP_KEY_IMAGE_QUALITY);
: (int) resultMap.get(ImagePickerCache.MAP_KEY_IMAGE_QUALITY);

newPathList.add(imageResizer.resizeImageIfNeeded(path, maxWidth, maxHeight, imageQuality));
}
resultMap.put(cache.MAP_KEY_PATH_LIST, newPathList);
resultMap.put(cache.MAP_KEY_PATH, newPathList.get(newPathList.size() - 1));
resultMap.put(ImagePickerCache.MAP_KEY_PATH_LIST, newPathList);
resultMap.put(ImagePickerCache.MAP_KEY_PATH, newPathList.get(newPathList.size() - 1));
}
if (resultMap.isEmpty()) {
result.success(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,12 @@ public void onMethodCall(MethodCall call, MethodChannel.Result rawResult) {
int imageSource;
ImagePickerDelegate delegate = activityState.getDelegate();
if (call.argument("cameraDevice") != null) {
CameraDevice device;
ImagePickerDelegate.CameraDevice device;
int deviceIntValue = call.argument("cameraDevice");
if (deviceIntValue == CAMERA_DEVICE_FRONT) {
device = CameraDevice.FRONT;
device = ImagePickerDelegate.CameraDevice.FRONT;
} else {
device = CameraDevice.REAR;
device = ImagePickerDelegate.CameraDevice.REAR;
}
delegate.setCameraDevice(device);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ allprojects {
google()
mavenCentral()
}
// Build the plugin project with warnings enabled. This is here rather than
// in the plugin itself to avoid breaking clients that have different
// warnings (e.g., deprecation warnings from a newer SDK than this project
// builds with).
gradle.projectsEvaluated {
project(":image_picker_android") {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all" << "-Werror"
}
}
}
}

rootProject.buildDir = '../build'
Expand Down
2 changes: 1 addition & 1 deletion packages/image_picker/image_picker_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ 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.5+7
version: 0.8.5+8

environment:
sdk: ">=2.14.0 <3.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ allprojects {
google()
mavenCentral()
}
// Build the plugin project with warnings enabled. This is here rather than
// in the plugin itself to avoid breaking clients that have different
// warnings (e.g., deprecation warnings from a newer SDK than this project
// builds with).
gradle.projectsEvaluated {
project(":in_app_purchase_android") {
tasks.withType(JavaCompile) {
// TODO(stuartmorgan): Enable this. See
// https://github.com/flutter/flutter/issues/91868
//options.compilerArgs << "-Xlint:all" << "-Werror"
}
}
}
}

rootProject.buildDir = '../build'
Expand Down
4 changes: 4 additions & 0 deletions packages/local_auth/local_auth_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.20

* Fixes compilation warnings.

## 1.0.19

* Updates links for the merge of flutter/plugins into flutter/packages.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugin.common.PluginRegistry.Registrar;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same deprecation issue here.

import io.flutter.plugins.localauth.AuthenticationHelper.AuthCompletionHandler;
import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicBoolean;
Expand Down Expand Up @@ -78,7 +77,7 @@ public boolean onActivityResult(int requestCode, int resultCode, Intent data) {
* io.flutter.plugin.common.BinaryMessenger}.
*/
@SuppressWarnings("deprecation")
public static void registerWith(Registrar registrar) {
public static void registerWith(PluginRegistry.Registrar registrar) {
final MethodChannel channel = new MethodChannel(registrar.messenger(), CHANNEL_NAME);
final LocalAuthPlugin plugin = new LocalAuthPlugin();
plugin.activity = registrar.activity();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ allprojects {
google()
mavenCentral()
}
// Build the plugin project with warnings enabled. This is here rather than
// in the plugin itself to avoid breaking clients that have different
// warnings (e.g., deprecation warnings from a newer SDK than this project
// builds with).
gradle.projectsEvaluated {
project(":local_auth_android") {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all" << "-Werror"
}
}
}
}

rootProject.buildDir = '../build'
Expand Down
2 changes: 1 addition & 1 deletion packages/local_auth/local_auth_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: local_auth_android
description: Android implementation of the local_auth plugin.
repository: https://github.com/flutter/packages/tree/main/packages/local_auth/local_auth_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+local_auth%22
version: 1.0.19
version: 1.0.20

environment:
sdk: ">=2.14.0 <3.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ allprojects {
google()
mavenCentral()
}
// Build the plugin project with warnings enabled. This is here rather than
// in the plugin itself to avoid breaking clients that have different
// warnings (e.g., deprecation warnings from a newer SDK than this project
// builds with).
gradle.projectsEvaluated {
project(":path_provider_android") {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all" << "-Werror"
}
}
}
}

rootProject.buildDir = '../build'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ allprojects {
google()
mavenCentral()
}
// Build the plugin project with warnings enabled. This is here rather than
// in the plugin itself to avoid breaking clients that have different
// warnings (e.g., deprecation warnings from a newer SDK than this project
// builds with).
gradle.projectsEvaluated {
project(":quick_actions_android") {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all" << "-Werror"
}
}
}
}

rootProject.buildDir = '../build'
Expand Down
Loading