diff options
3 files changed, 19 insertions, 2 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiUtils.kt b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiUtils.kt index cca43b92ef19..84d61fc86073 100644 --- a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiUtils.kt +++ b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiUtils.kt @@ -501,6 +501,7 @@ open class WifiUtils { dialogWindowType: Int, onStartActivity: (intent: Intent) -> Unit, onAllowed: () -> Unit, + onStartAapmActivity: (intent: Intent) -> Unit = onStartActivity, ): Job = coroutineScope.launch { val wifiManager = context.getSystemService(WifiManager::class.java) ?: return@launch @@ -510,7 +511,7 @@ open class WifiUtils { AdvancedProtectionManager.FEATURE_ID_DISALLOW_WEP, AdvancedProtectionManager.SUPPORT_DIALOG_TYPE_BLOCKED_INTERACTION) intent.putExtra(DIALOG_WINDOW_TYPE, dialogWindowType) - withContext(Dispatchers.Main) { onStartActivity(intent) } + withContext(Dispatchers.Main) { onStartAapmActivity(intent) } } else if (wifiManager.isWepSupported == true && wifiManager.queryWepAllowed()) { withContext(Dispatchers.Main) { onAllowed() } } else { diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetAdapter.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetAdapter.java index b21c3e4e44e1..6236fff87f63 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetAdapter.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetAdapter.java @@ -196,11 +196,16 @@ public class InternetAdapter extends RecyclerView.Adapter<InternetAdapter.Intern if (mJob == null) { mJob = WifiUtils.checkWepAllowed(mContext, mCoroutineScope, wifiEntry.getSsid(), WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG, intent -> { - mInternetDetailsContentController.startActivityForDialog(intent); + mInternetDetailsContentController + .startActivityForDialog(intent); return null; }, () -> { wifiConnect(wifiEntry, view); return null; + }, intent -> { + mInternetDetailsContentController + .startActivityForDialogDismissDialogFirst(intent, view); + return null; }); } return; diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDetailsContentController.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDetailsContentController.java index 945e051606b9..2497daebdd6d 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDetailsContentController.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDetailsContentController.java @@ -784,6 +784,17 @@ public class InternetDetailsContentController implements AccessPointController.A mActivityStarter.startActivity(intent, false /* dismissShade */); } + // Closes the dialog first, as the WEP dialog is in a different process and can have weird + // interactions otherwise. + void startActivityForDialogDismissDialogFirst(Intent intent, View view) { + ActivityTransitionAnimator.Controller controller = + mDialogTransitionAnimator.createActivityTransitionController(view); + if (mCallback != null) { + mCallback.dismissDialog(); + } + mActivityStarter.startActivity(intent, false /* dismissShade */, controller); + } + void launchNetworkSetting(View view) { startActivity(getSettingsIntent(), view); } |