@capacitor/android 3.3.2 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/capacitor/build.gradle +1 -1
- package/capacitor/src/main/java/com/getcapacitor/Bridge.java +12 -5
- package/capacitor/src/main/java/com/getcapacitor/BridgeWebChromeClient.java +6 -2
- package/capacitor/src/main/java/com/getcapacitor/PluginCall.java +18 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,52 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.4.1](https://github.com/ionic-team/capacitor/compare/3.4.0...3.4.1) (2022-02-09)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @capacitor/android
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.4.0](https://github.com/ionic-team/capacitor/compare/3.3.4...3.4.0) (2022-01-19)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **android:** prevent input file crash if accept has . ([#5363](https://github.com/ionic-team/capacitor/issues/5363)) ([bdacb30](https://github.com/ionic-team/capacitor/commit/bdacb300bb6391dc4b84bb2bab075df993a15cba))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **android:** Add getLong helper on PluginCall ([#5235](https://github.com/ionic-team/capacitor/issues/5235)) ([26261fb](https://github.com/ionic-team/capacitor/commit/26261fb49211330c4db72c259359565da7d7bc4b))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [3.3.4](https://github.com/ionic-team/capacitor/compare/3.3.3...3.3.4) (2022-01-05)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* **android:** Prevent crash if activity killed on input file ([#5328](https://github.com/ionic-team/capacitor/issues/5328)) ([a206841](https://github.com/ionic-team/capacitor/commit/a20684180a9b6fd50547ae578f21531faa116da5))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## [3.3.3](https://github.com/ionic-team/capacitor/compare/3.3.2...3.3.3) (2021-12-08)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Bug Fixes
|
|
45
|
+
|
|
46
|
+
* **android:** Prevent crash in restoreInstanceState if bundleData is null ([#5289](https://github.com/ionic-team/capacitor/issues/5289)) ([622d62f](https://github.com/ionic-team/capacitor/commit/622d62fc0d7cd79558bf6f11331bd7d6690aa4f9))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
6
52
|
## [3.3.2](https://github.com/ionic-team/capacitor/compare/3.3.1...3.3.2) (2021-11-17)
|
|
7
53
|
|
|
8
54
|
|
package/capacitor/build.gradle
CHANGED
|
@@ -807,8 +807,10 @@ public class Bridge {
|
|
|
807
807
|
// Let the plugin restore any state it needs
|
|
808
808
|
Bundle bundleData = savedInstanceState.getBundle(BUNDLE_PLUGIN_CALL_BUNDLE_KEY);
|
|
809
809
|
PluginHandle lastPlugin = getPlugin(lastPluginId);
|
|
810
|
-
if (lastPlugin != null) {
|
|
810
|
+
if (bundleData != null && lastPlugin != null) {
|
|
811
811
|
lastPlugin.getInstance().restoreState(bundleData);
|
|
812
|
+
} else {
|
|
813
|
+
Logger.error("Unable to restore last plugin call");
|
|
812
814
|
}
|
|
813
815
|
}
|
|
814
816
|
}
|
|
@@ -823,10 +825,15 @@ public class Bridge {
|
|
|
823
825
|
PluginHandle handle = getPlugin(call.getPluginId());
|
|
824
826
|
|
|
825
827
|
if (handle != null) {
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
828
|
+
Bundle bundle = handle.getInstance().saveInstanceState();
|
|
829
|
+
if (bundle != null) {
|
|
830
|
+
outState.putString(BUNDLE_LAST_PLUGIN_ID_KEY, call.getPluginId());
|
|
831
|
+
outState.putString(BUNDLE_LAST_PLUGIN_CALL_METHOD_NAME_KEY, call.getMethodName());
|
|
832
|
+
outState.putString(BUNDLE_PLUGIN_CALL_OPTIONS_SAVED_KEY, call.getData().toString());
|
|
833
|
+
outState.putBundle(BUNDLE_PLUGIN_CALL_BUNDLE_KEY, bundle);
|
|
834
|
+
} else {
|
|
835
|
+
Logger.error("Couldn't save last " + call.getPluginId() + "'s Plugin " + call.getMethodName() + " call");
|
|
836
|
+
}
|
|
830
837
|
}
|
|
831
838
|
}
|
|
832
839
|
}
|
|
@@ -70,7 +70,11 @@ public class BridgeWebChromeClient extends WebChromeClient {
|
|
|
70
70
|
activityLauncher =
|
|
71
71
|
bridge.registerForActivityResult(
|
|
72
72
|
new ActivityResultContracts.StartActivityForResult(),
|
|
73
|
-
result ->
|
|
73
|
+
result -> {
|
|
74
|
+
if (activityListener != null) {
|
|
75
|
+
activityListener.onActivityResult(result);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
74
78
|
);
|
|
75
79
|
}
|
|
76
80
|
|
|
@@ -410,7 +414,7 @@ public class BridgeWebChromeClient extends WebChromeClient {
|
|
|
410
414
|
if (fileChooserParams.getMode() == FileChooserParams.MODE_OPEN_MULTIPLE) {
|
|
411
415
|
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
|
|
412
416
|
}
|
|
413
|
-
if (fileChooserParams.getAcceptTypes().length > 1) {
|
|
417
|
+
if (fileChooserParams.getAcceptTypes().length > 1 || intent.getType().startsWith(".")) {
|
|
414
418
|
String[] validTypes = getValidTypes(fileChooserParams.getAcceptTypes());
|
|
415
419
|
intent.putExtra(Intent.EXTRA_MIME_TYPES, validTypes);
|
|
416
420
|
if (intent.getType().startsWith(".")) {
|
|
@@ -214,6 +214,24 @@ public class PluginCall {
|
|
|
214
214
|
return defaultValue;
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
+
@Nullable
|
|
218
|
+
public Long getLong(String name) {
|
|
219
|
+
return this.getLong(name, null);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
@Nullable
|
|
223
|
+
public Long getLong(String name, @Nullable Long defaultValue) {
|
|
224
|
+
Object value = this.data.opt(name);
|
|
225
|
+
if (value == null) {
|
|
226
|
+
return defaultValue;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (value instanceof Long) {
|
|
230
|
+
return (Long) value;
|
|
231
|
+
}
|
|
232
|
+
return defaultValue;
|
|
233
|
+
}
|
|
234
|
+
|
|
217
235
|
@Nullable
|
|
218
236
|
public Float getFloat(String name) {
|
|
219
237
|
return this.getFloat(name, null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/android",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.1",
|
|
4
4
|
"description": "Capacitor: Cross-platform apps with JavaScript and the web",
|
|
5
5
|
"homepage": "https://capacitorjs.com",
|
|
6
6
|
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"verify": "./gradlew clean lint build test -b capacitor/build.gradle"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@capacitor/core": "^3.
|
|
25
|
+
"@capacitor/core": "^3.4.0"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "bc7b49ff2ad242fecff7bcb3900c627ff6880f7b"
|
|
31
31
|
}
|