Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc3f93de authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Go back to posting onTaskInfoChanged callback

It is possible for us to send onTaskInfoChanged before onTaskAppear
callbak since we post onTaskAppear but we don't post onTaskInfoChanged.
The change was introduced in ag/12719145, however we have to rethink how
we want to approach whatever problem we are trying to solve there in a
way that doesn't affect callback ordering.

Fixes: 172196078
Bug: 167447693
Bug: 171306573
Test: Timing issue that is ver difficult to test
Change-Id: I39cdc241cec1729487dd111af593724cf04e1e8d
parent f069be7b
Loading
Loading
Loading
Loading
+25 −21
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub {
                return;
            }
            ProtoLog.v(WM_DEBUG_WINDOW_ORGANIZER, "Task info changed taskId=%d", task.mTaskId);
            mDeferTaskOrgCallbacksConsumer.accept(() -> {
                if (!task.isOrganized()) {
                    // This is safe to ignore if the task is no longer organized
                    return;
@@ -172,6 +173,7 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub {
                } catch (RemoteException e) {
                    Slog.e(TAG, "Exception sending onTaskInfoChanged callback", e);
                }
            });
        }

        void onBackPressedOnTaskRoot(Task task) {
@@ -181,6 +183,7 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub {
                // Skip if the task has not yet received taskAppeared().
                return;
            }
            mDeferTaskOrgCallbacksConsumer.accept(() -> {
                if (!task.isOrganized()) {
                    // This is safe to ignore if the task is no longer organized
                    return;
@@ -190,6 +193,7 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub {
                } catch (Exception e) {
                    Slog.e(TAG, "Exception sending onBackPressedOnTaskRoot callback", e);
                }
            });
        }
    }