diff options
author | 2025-03-21 09:41:03 -0700 | |
---|---|---|
committer | 2025-03-21 09:41:03 -0700 | |
commit | e53bc444fd1ef726fc45ef1577691591e554b630 (patch) | |
tree | 93b8daed86afbdd001be745d64e6c5649117c360 | |
parent | 06bdbb885592eca8b3be02942a90add3025a4939 (diff) |
[AAPM] Fix AAPM QS behavior.
The bugs are caused by the interaction of three windows:
1. The notification shade
2. The WIfi QuickSetting Dialog
3. The AAPM Action Blocked dialog.
Dismissing (1) and (2) resolves the listed bugs. The current
`startActivity` method causes janky animation - explicitly dismissing the
dialog first smoothes this out.
Bug: 404595536, 404595701, 398892533
Test: Manually tested on device
Flag: EXEMPT_BUGFIX
Change-Id: I99533e54d65bb75f546c519d13f1107f1ede149e
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); } |