diff options
| author | 2022-03-29 13:22:28 +0800 | |
|---|---|---|
| committer | 2022-04-01 16:49:17 +0800 | |
| commit | 84f2c89e9fb8cbee45ea5585a32bd607d69d2ec4 (patch) | |
| tree | f678e51df09fd969cd5eb241f9b7045f05297763 | |
| parent | 94d1958df57d083a06939490b2860128ebfef3b6 (diff) | |
Prevents the binder call fail from freeze when send app visibility.
The client visibility state could remains GONE if the binder call
IWindow#dispatchAppVisibility fail. A possible reason is the binder is
still freeze and the buffer is fulled.
Try to unfreeze the process binder call before set visibility change,
so and top resumed.
Bug: 225530340
Test: verifyapps to dispatch app visibility happen after unfreeze.
Change-Id: I9c931dd72d7803c2add0348aa0d094333f94c73e
3 files changed, 5 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 0b52fd643a1c..971582131afb 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -1403,6 +1403,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A + "activityRecord=%s", this); return false; } + if (onTop) { + app.addToPendingTop(); + } try { ProtoLog.v(WM_DEBUG_STATES, "Sending position change to %s, onTop: %b", this, onTop); diff --git a/services/core/java/com/android/server/wm/TaskFragment.java b/services/core/java/com/android/server/wm/TaskFragment.java index 23df429c3f24..80a914be7e2e 100644 --- a/services/core/java/com/android/server/wm/TaskFragment.java +++ b/services/core/java/com/android/server/wm/TaskFragment.java @@ -1232,6 +1232,7 @@ class TaskFragment extends WindowContainer<WindowContainer> { // This activity is now becoming visible. if (!next.mVisibleRequested || next.stopped || lastActivityTranslucent) { + next.app.addToPendingTop(); next.setVisibility(true); } diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 76ff4c0789cc..6a558a5bf2e0 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -3526,6 +3526,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP "Setting visibility of " + this + ": " + clientVisible); mClient.dispatchAppVisibility(clientVisible); } catch (RemoteException e) { + Slog.w(TAG, "Exception thrown during dispatchAppVisibility " + this, e); } } |