|
27 | 27 | import android.content.ComponentCallbacks2; |
28 | 28 | import android.content.Context; |
29 | 29 | import android.content.DialogInterface; |
30 | | -import android.content.DialogInterface.OnCancelListener; |
31 | 30 | import android.content.Intent; |
32 | 31 | import android.content.IntentFilter; |
33 | 32 | import android.content.pm.PackageManager; |
|
69 | 68 | import android.util.DisplayMetrics; |
70 | 69 | import android.util.EventLog; |
71 | 70 | import android.util.Log; |
72 | | -import android.view.Display; |
73 | 71 | import android.view.Gravity; |
74 | 72 | import android.view.HapticFeedbackConstants; |
75 | 73 | import android.view.HardwareCanvas; |
|
87 | 85 | import android.view.ViewGroup; |
88 | 86 | import android.view.ViewParent; |
89 | 87 | import android.view.ViewRootImpl; |
90 | | -import android.view.WindowManager; |
91 | 88 | import android.view.accessibility.AccessibilityEvent; |
92 | 89 | import android.view.accessibility.AccessibilityManager; |
93 | 90 | import android.view.accessibility.AccessibilityNodeInfo; |
|
136 | 133 | import java.util.Map; |
137 | 134 | import java.util.Set; |
138 | 135 | import java.util.Vector; |
139 | | -import java.util.concurrent.CountDownLatch; |
140 | | -import java.util.regex.Matcher; |
141 | | -import java.util.regex.Pattern; |
142 | 136 |
|
143 | 137 | /** |
144 | 138 | * Implements a backend provider for the {@link WebView} public API. |
@@ -1891,9 +1885,9 @@ public void onClick(DialogInterface dialog, int which) { |
1891 | 1885 | mSavePasswordDialog = null; |
1892 | 1886 | } |
1893 | 1887 | }) |
1894 | | - .setOnCancelListener(new OnCancelListener() { |
| 1888 | + .setOnDismissListener(new DialogInterface.OnDismissListener() { |
1895 | 1889 | @Override |
1896 | | - public void onCancel(DialogInterface dialog) { |
| 1890 | + public void onDismiss(DialogInterface dialog) { |
1897 | 1891 | if (mResumeMsg != null) { |
1898 | 1892 | resumeMsg.sendToTarget(); |
1899 | 1893 | mResumeMsg = null; |
@@ -2098,14 +2092,18 @@ private void clearHelpers() { |
2098 | 2092 | hideSoftKeyboard(); |
2099 | 2093 | clearActionModes(); |
2100 | 2094 | dismissFullScreenMode(); |
2101 | | - cancelSelectDialog(); |
| 2095 | + cancelDialogs(); |
2102 | 2096 | } |
2103 | 2097 |
|
2104 | | - private void cancelSelectDialog() { |
| 2098 | + private void cancelDialogs() { |
2105 | 2099 | if (mListBoxDialog != null) { |
2106 | 2100 | mListBoxDialog.cancel(); |
2107 | 2101 | mListBoxDialog = null; |
2108 | 2102 | } |
| 2103 | + if (mSavePasswordDialog != null) { |
| 2104 | + mSavePasswordDialog.dismiss(); |
| 2105 | + mSavePasswordDialog = null; |
| 2106 | + } |
2109 | 2107 | } |
2110 | 2108 |
|
2111 | 2109 | /** |
@@ -2133,15 +2131,6 @@ private void ensureFunctorDetached() { |
2133 | 2131 |
|
2134 | 2132 | private void destroyJava() { |
2135 | 2133 | mCallbackProxy.blockMessages(); |
2136 | | - clearHelpers(); |
2137 | | - if (mListBoxDialog != null) { |
2138 | | - mListBoxDialog.dismiss(); |
2139 | | - mListBoxDialog = null; |
2140 | | - } |
2141 | | - if (mSavePasswordDialog != null) { |
2142 | | - mSavePasswordDialog.dismiss(); |
2143 | | - mSavePasswordDialog = null; |
2144 | | - } |
2145 | 2134 | if (mWebViewCore != null) { |
2146 | 2135 | // Tell WebViewCore to destroy itself |
2147 | 2136 | synchronized (this) { |
@@ -3492,7 +3481,7 @@ public void onPause() { |
3492 | 3481 | nativeSetPauseDrawing(mNativeClass, true); |
3493 | 3482 | } |
3494 | 3483 |
|
3495 | | - cancelSelectDialog(); |
| 3484 | + cancelDialogs(); |
3496 | 3485 | WebCoreThreadWatchdog.pause(); |
3497 | 3486 | } |
3498 | 3487 | } |
|
0 commit comments