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

Commit 49e13a2e authored by Massimo Carli's avatar Massimo Carli Committed by Android (Google) Code Review
Browse files

Merge "Demote exception to log message" into main

parents 1fc57972 7dde6d40
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -143,20 +143,29 @@ public class FullscreenTaskListener implements ShellTaskOrganizer.TaskListener {

    @Override
    public void attachChildSurfaceToTask(int taskId, SurfaceControl.Builder b) {
        b.setParent(findTaskSurface(taskId));
        final SurfaceControl taskSurface = findTaskSurface(taskId);
        if (taskSurface != null) {
            b.setParent(taskSurface);
        }
    }

    @Override
    public void reparentChildSurfaceToTask(int taskId, SurfaceControl sc,
            SurfaceControl.Transaction t) {
        t.reparent(sc, findTaskSurface(taskId));
        final SurfaceControl taskSurface = findTaskSurface(taskId);
        if (taskSurface != null) {
            t.reparent(sc, taskSurface);
        }
    }

    private SurfaceControl findTaskSurface(int taskId) {
        if (!mTasks.contains(taskId)) {
            throw new IllegalArgumentException("There is no surface for taskId=" + taskId);
        final State state = mTasks.get(taskId);
        if (state != null) {
            return state.mLeash;
        }
        return mTasks.get(taskId).mLeash;
        ProtoLog.w(ShellProtoLogGroup.WM_SHELL_TASK_ORG, "Surface not found: #%d",
                taskId);
        return null;
    }

    @Override