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

Commit debccf10 authored by Chris Li's avatar Chris Li
Browse files

Dispatch WindowStateInsetsControlChangeItem

Bug: 339380439
Test: refactor, pass existing tests
Flag: com.android.window.flags.insets_control_changed_item
Change-Id: If95ba8f513f9c8d09a73f67b88cf840920e893ed
parent b2f6997e
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -188,6 +188,7 @@ import android.annotation.Nullable;
import android.app.ActivityTaskManager;
import android.app.AppOpsManager;
import android.app.admin.DevicePolicyCache;
import android.app.servertransaction.WindowStateInsetsControlChangeItem;
import android.app.servertransaction.WindowStateResizeItem;
import android.content.Context;
import android.content.res.Configuration;
@@ -3818,13 +3819,19 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        }
        final InsetsStateController stateController =
                getDisplayContent().getInsetsStateController();
        final InsetsState insetsState = getCompatInsetsState();
        mLastReportedActiveControls.set(stateController.getControlsForDispatch(this));
        if (Flags.insetsControlChangedItem()) {
            getProcess().scheduleClientTransactionItem(WindowStateInsetsControlChangeItem.obtain(
                    mClient, insetsState, mLastReportedActiveControls));
        } else {
            try {
            mClient.insetsControlChanged(getCompatInsetsState(), mLastReportedActiveControls);
                mClient.insetsControlChanged(insetsState, mLastReportedActiveControls);
            } catch (RemoteException e) {
                Slog.w(TAG, "Failed to deliver inset control state change to w=" + this, e);
            }
        }
    }

    @Override
    public WindowState getWindow() {