Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/package_info/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.4.0+6

* Fix Android compiler warnings.

## 0.4.0+5

* Add iOS-specific warning to README.md.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void onMethodCall(MethodCall call, Result result) {
PackageManager pm = context.getPackageManager();
PackageInfo info = pm.getPackageInfo(context.getPackageName(), 0);

Map<String, String> map = new HashMap<String, String>();
Map<String, String> map = new HashMap<>();
map.put("appName", info.applicationInfo.loadLabel(pm).toString());
map.put("packageName", context.getPackageName());
map.put("version", info.versionName);
Expand All @@ -54,11 +54,11 @@ public void onMethodCall(MethodCall call, Result result) {
}
}

@SuppressWarnings("deprecation")
private static long getLongVersionCode(PackageInfo info) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
return info.getLongVersionCode();
}
//noinspection deprecation
return info.versionCode;
}
}
2 changes: 1 addition & 1 deletion packages/package_info/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for querying information about the application
package, such as CFBundleVersion on iOS or versionCode on Android.
author: Flutter Team <flutter-dev@googlegroups.com>
homepage: https://github.com/flutter/plugins/tree/master/packages/package_info
version: 0.4.0+5
version: 0.4.0+6

flutter:
plugin:
Expand Down