Skip surface placement if the given insets will not change

This reduces the amount of surface placement:
 2~3 times when notification shade expands or collapses.
 7 times when display rotates.
 6~9 times when fold state changes.

Currently even if the client knows the insets are not changed, it still
need to tell server side to clear a pending state:
1. Client performs relayout with RELAYOUT_INSETS_PENDING if there has a
   insets listener. That sets WindowState#mGivenInsetsPending to true.
2. The listener assigns the insets according to the result of relayout.
3. Client calls WindowSession#setInsets to send the insets and consume
   the pending state mGivenInsetsPending (set to false).

Besides, by combing the conditions of mGivenInsetsPending to client
side, it can reduce IPC calls such as 3 times setInsets from nav bar.

Bug: 294796470
Test: atest WindowInsetsControllerTests

Change-Id: Ice3320a4b694c771332107e4d8c77927e0260c8b
4 files changed