Skip to content

Commit ddea6d4

Browse files
committed
Client should use setPaymentRequestEnabled if only WebViewFeatureProxyApi#isFeatureSupported returns true
1 parent 5f7f689 commit ddea6d4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebSettingsCompatProxyApi.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
package io.flutter.plugins.webviewflutter;
66

7+
import android.annotation.SuppressLint;
78
import android.webkit.WebSettings;
89
import androidx.annotation.NonNull;
910
import androidx.webkit.WebSettingsCompat;
10-
import androidx.webkit.WebViewFeature;
1111

1212
/**
1313
* Proxy API implementation for {@link WebSettingsCompat}.
@@ -20,10 +20,13 @@ public WebSettingsCompatProxyApi(@NonNull ProxyApiRegistrar pigeonRegistrar) {
2020
super(pigeonRegistrar);
2121
}
2222

23+
/**
24+
* This method should only be called if {@link WebViewFeatureProxyApi#isFeatureSupported(String)}
25+
* with PAYMENT_REQUEST returns true.
26+
*/
27+
@SuppressLint("RequiresFeature")
2328
@Override
2429
public void setPaymentRequestEnabled(@NonNull WebSettings webSettings, boolean enabled) {
25-
if (WebViewFeature.isFeatureSupported(WebViewFeature.PAYMENT_REQUEST)) {
26-
WebSettingsCompat.setPaymentRequestEnabled(webSettings, enabled);
27-
}
30+
WebSettingsCompat.setPaymentRequestEnabled(webSettings, enabled);
2831
}
2932
}

0 commit comments

Comments
 (0)