summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeng Wang <mewan@google.com>2021-06-01 19:40:32 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-06-01 19:40:32 +0000
commit2e13ec53fb7e9a6f82bdab316e6ec36d85b59e5d (patch)
tree2f433854d0632a62db9173fde84bf5c605d0dee2
parent4b7e559ca6b2607ed435c1b6b2c523d2566e2b31 (diff)
parent117e3f03c504d174f5fbe322319778dc7a05773c (diff)
downloadImsServiceEntitlement-2e13ec53fb7e9a6f82bdab316e6ec36d85b59e5d.tar.gz
Merge "Webview JsInterface: run finishFlow() on main thread." into sc-dev
-rw-r--r--src/com/android/imsserviceentitlement/WfcWebPortalFragment.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/imsserviceentitlement/WfcWebPortalFragment.java b/src/com/android/imsserviceentitlement/WfcWebPortalFragment.java
index 8f3af88..984bf28 100644
--- a/src/com/android/imsserviceentitlement/WfcWebPortalFragment.java
+++ b/src/com/android/imsserviceentitlement/WfcWebPortalFragment.java
@@ -32,6 +32,7 @@ import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
+import java.util.concurrent.Executor;
/** A fragment of WebView to render WFC T&C and emergency address web portal */
public class WfcWebPortalFragment extends Fragment {
@@ -137,9 +138,11 @@ public class WfcWebPortalFragment extends Fragment {
/** Emergency address websheet javascript callback. */
private class JsInterface {
private final WfcActivationUi mUi;
+ private final Executor mMainExecutor;
JsInterface(Activity activity) {
mUi = (WfcActivationUi) activity;
+ mMainExecutor = activity.getMainExecutor();
}
/**
@@ -150,7 +153,7 @@ public class WfcWebPortalFragment extends Fragment {
public void entitlementChanged() {
Log.d(TAG, "#entitlementChanged");
mFinishFlow = true;
- mUi.getController().finishFlow();
+ mMainExecutor.execute(() -> mUi.getController().finishFlow());
}
/**