Add case for SysUI toast with Gravity.NO_GRAVITY.

Multi-window (freeform) fullscreen implementations of SysUI don't always
have toast notifications anchored at the bottom of the window due to the
freeform nature of window management.  In these cases the toast
notifications should be treated similar to "centered" toasts with
respect to render origin.

This CL adds a SystemUiHelper#isNonOverlappingMultiWindowMode that
to quickly check if this device is in this mode.  In ToastTest it's
used to branch the test validation logic to Gravity.NO_GRAVITY.

Bug: 361623522
Test: android.widget.cts.ToastTest#testAccessMargin_whenCustomToast now
pass on multy-window fullscreen SysUI.
(cherry picked from https://android-review.googlesource.com/q/commit:f8499d8aff04873522fe36e207cc507dd4dec4e6)
Merged-In: I88733a1307c658aa6e58b222e543bb83246bbb24
Change-Id: I88733a1307c658aa6e58b222e543bb83246bbb24

Original patch:
 From f8499d8aff04873522fe36e207cc507dd4dec4e6 Mon Sep 17 00:00:00 2001
From: Gen Li <genli@google.com>
Date: Tue, 05 Nov 2024 15:18:26 -0800
Subject: [PATCH] Add case for SysUI toast with Gravity.NO_GRAVITY.

Multi-window (freeform) fullscreen implementations of SysUI don't always
have toast notifications anchored at the bottom of the window due to the
freeform nature of window management.  In these cases the toast
notifications should be treated similar to "centered" toasts with
respect to render origin.

This CL adds a SystemUiHelper#isNonOverlappingMultiWindowMode that
to quickly check if this device is in this mode.  In ToastTest it's
used to branch the test validation logic to Gravity.NO_GRAVITY.

Bug: 361623522
Test: android.widget.cts.ToastTest#testAccessMargin_whenCustomToast now
pass on multy-window fullscreen SysUI.
Flag: EXEMPT test fix

Change-Id: I88733a1307c658aa6e58b222e543bb83246bbb24
---
5 files changed