-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[ci+various] Partially enable javac warning checks #3293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
91c68e5
734eb54
88d046c
d7fe1bd
cea94d5
ff90733
bad3270
13905dd
593870e
23ed9d9
52c5f02
f388008
532ffb9
c1a68e2
7dfd1e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 2.4.8 | ||
|
||
* Fixes compilation warnings. | ||
|
||
## 2.4.7 | ||
|
||
* Updates annotation dependency. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
|
@@ -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()); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
## NEXT | ||
## 0.8.5+9 | ||
|
||
* Fixes compilation warnings. | ||
* Updates compileSdkVersion to 33. | ||
|
||
## 0.8.5+8 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,12 +31,6 @@ | |
import java.util.Map; | ||
import java.util.UUID; | ||
|
||
enum CameraDevice { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
* | ||
|
@@ -86,6 +80,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; | ||
|
@@ -222,21 +221,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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
|
@@ -450,6 +450,8 @@ private File createTemporaryWritableFile(String suffix) { | |
|
||
private void grantUriPermissions(Intent intent, Uri imageUri) { | ||
PackageManager packageManager = activity.getPackageManager(); | ||
// TODO(stuartmorgan): Add new codepath: https://github.com/flutter/flutter/issues/121816 | ||
@SuppressWarnings("deprecation") | ||
List<ResolveInfo> compatibleActivities = | ||
packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); | ||
|
||
|
There was a problem hiding this comment.
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.