Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[share] MethodCallHandler.java uses unchecked or unsafe operations #3004

Merged
merged 14 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions packages/share/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.5+1

* Avoiding uses unchecked or unsafe Object Type Casting

## 0.6.5

* Added support for sharing files
Expand Down
5 changes: 5 additions & 0 deletions packages/share/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
group 'io.flutter.plugins.share'
version '1.0-SNAPSHOT'
def args = ["-Xlint:deprecation","-Xlint:unchecked","-Werror"]

buildscript {
repositories {
Expand All @@ -19,6 +20,10 @@ rootProject.allprojects {
}
}

project.getTasks().withType(JavaCompile){
options.compilerArgs.addAll(args)
}

apply plugin: 'com.android.library'

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,21 @@ public void onMethodCall(MethodCall call, MethodChannel.Result result) {
case "share":
expectMapArguments(call);
// Android does not support showing the share sheet at a particular point on screen.
share.share((String) call.argument("text"), (String) call.argument("subject"));
String text = call.argument("text");
String subject = call.argument("subject");
share.share(text, subject);
result.success(null);
break;
case "shareFiles":
expectMapArguments(call);

List<String> paths = call.argument("paths");
List<String> mimeTypes = call.argument("mimeTypes");
text = call.argument("text");
subject = call.argument("subject");
// Android does not support showing the share sheet at a particular point on screen.
try {
share.shareFiles(
(List<String>) call.argument("paths"),
(List<String>) call.argument("mimeTypes"),
(String) call.argument("text"),
(String) call.argument("subject"));
share.shareFiles(paths, mimeTypes, text, subject);
result.success(null);
} catch (IOException e) {
result.error(e.getMessage(), null, null);
Expand Down
2 changes: 1 addition & 1 deletion packages/share/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/share
# 0.6.y+z is compatible with 1.0.0, if you land a breaking change bump
# the version to 2.0.0.
# See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0
version: 0.6.5
version: 0.6.5+1

flutter:
plugin:
Expand Down