Return STATUS_UNSUPPORTED if WindowAreaComponent is not supported

Devices may support WM Extensions and use the reference implementation,
but may not support WindowAreaComponent features. This change returns
UNSUPPORTED values for status updates on these devices

Bug: 269338840
Test: ExtensionRearDisplayTest#testRearDisplayStatusUnsupported_rearDisplayDeviceStateNotDefined
Merged-In: I4b8d6c50474849442f67b18040ecee19c2b5e13b
Change-Id: I4b8d6c50474849442f67b18040ecee19c2b5e13b
This commit is contained in:
Kenneth Ford
2023-02-14 22:11:48 +00:00
parent 61d978c3ac
commit 3f4dc8233e

View File

@@ -187,6 +187,10 @@ public class WindowAreaComponentImpl implements WindowAreaComponent,
@GuardedBy("mLock")
private int getCurrentStatus() {
if (mRearDisplayState == INVALID_DEVICE_STATE) {
return WindowAreaComponent.STATUS_UNSUPPORTED;
}
if (mRearDisplaySessionStatus == WindowAreaComponent.SESSION_STATE_ACTIVE
|| isRearDisplayActive()) {
return WindowAreaComponent.STATUS_UNAVAILABLE;