Skip to content

Commit

Permalink
fix #1462
Browse files Browse the repository at this point in the history
  • Loading branch information
pichillilorenzo committed Dec 15, 2022
1 parent c078c48 commit ffc7a4a
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 5.7.2+3

- Fixed "Xiaomi store - Conflict of Privacy Permissions, android.permission.MY_READ_INSTALLED_PACKAGES" [#1462](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1462)

## 5.7.2+2

- Fixed "Unexpected addWebMessageListener behaviour" [#1422](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1422)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,18 @@ public MyCookieManager(final InAppWebViewFlutterPlugin plugin) {
this.plugin = plugin;
channel = new MethodChannel(plugin.messenger, "com.pichillilorenzo/flutter_inappwebview_cookiemanager");
channel.setMethodCallHandler(this);
cookieManager = getCookieManager();
}

public static void init() {
if (cookieManager == null) {
cookieManager = getCookieManager();
}
}

@Override
public void onMethodCall(MethodCall call, MethodChannel.Result result) {
init();

switch (call.method) {
case "setCookie":
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,18 @@ public MyWebStorage(final InAppWebViewFlutterPlugin plugin) {
this.plugin = plugin;
channel = new MethodChannel(plugin.messenger, "com.pichillilorenzo/flutter_inappwebview_webstoragemanager");
channel.setMethodCallHandler(this);
webStorageManager = WebStorage.getInstance();
}

public static void init() {
if (webStorageManager == null) {
webStorageManager = WebStorage.getInstance();
}
}

@Override
public void onMethodCall(MethodCall call, MethodChannel.Result result) {
init();

switch (call.method) {
case "getOrigins":
getOrigins(result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,18 @@ public ServiceWorkerManager(final InAppWebViewFlutterPlugin plugin) {
this.plugin = plugin;
channel = new MethodChannel(plugin.messenger, "com.pichillilorenzo/flutter_inappwebview_android_serviceworkercontroller");
channel.setMethodCallHandler(this);
if (WebViewFeature.isFeatureSupported(WebViewFeature.SERVICE_WORKER_BASIC_USAGE)) {
}

public static void init() {
if (serviceWorkerController == null &&
WebViewFeature.isFeatureSupported(WebViewFeature.SERVICE_WORKER_BASIC_USAGE)) {
serviceWorkerController = ServiceWorkerControllerCompat.getInstance();
} else {
serviceWorkerController = null;
}
}

@Override
public void onMethodCall(MethodCall call, MethodChannel.Result result) {
init();
ServiceWorkerWebSettingsCompat serviceWorkerWebSettings = (serviceWorkerController != null) ? serviceWorkerController.getServiceWorkerWebSettings() : null;

switch (call.method) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,20 @@ public CredentialDatabaseHandler(final InAppWebViewFlutterPlugin plugin) {
this.plugin = plugin;
channel = new MethodChannel(plugin.messenger, "com.pichillilorenzo/flutter_inappwebview_credential_database");
channel.setMethodCallHandler(this);
credentialDatabase = CredentialDatabase.getInstance(plugin.applicationContext);
}

public static void init(@NonNull InAppWebViewFlutterPlugin plugin) {
if (credentialDatabase == null) {
credentialDatabase = CredentialDatabase.getInstance(plugin.applicationContext);
}
}

@Override
public void onMethodCall(MethodCall call, @NonNull MethodChannel.Result result) {
if (plugin != null) {
init(plugin);
}

switch (call.method) {
case "getAllAuthCredentials":
{
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_inappwebview
description: A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser window.
version: 5.7.2+2
version: 5.7.2+3
homepage: https://inappwebview.dev/
repository: https://github.com/pichillilorenzo/flutter_inappwebview
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
Expand Down

0 comments on commit ffc7a4a

Please sign in to comment.