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 instead of UNAVAILABLE for status updates on these devices. Bug: 269338840 Test: ExtensionRearDisplayTest#testRearDisplayStatusUnsupported_rearDisplayDeviceStateNotDefined Change-Id: I4b8d6c50474849442f67b18040ecee19c2b5e13b Merged-In: I4b8d6c50474849442f67b18040ecee19c2b5e13b
This commit is contained in:
@@ -263,8 +263,10 @@ public class WindowAreaComponentImpl implements WindowAreaComponent,
|
||||
return;
|
||||
}
|
||||
@WindowAreaStatus int currentStatus = getCurrentRearDisplayPresentationModeStatus();
|
||||
DisplayMetrics metrics =
|
||||
currentStatus == STATUS_UNSUPPORTED ? null : getRearDisplayMetrics();
|
||||
consumer.accept(
|
||||
new RearDisplayPresentationStatus(currentStatus, getRearDisplayMetrics()));
|
||||
new RearDisplayPresentationStatus(currentStatus, metrics));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -408,6 +410,10 @@ public class WindowAreaComponentImpl implements WindowAreaComponent,
|
||||
|
||||
@GuardedBy("mLock")
|
||||
private int getCurrentRearDisplayModeStatus() {
|
||||
if (mRearDisplayState == INVALID_DEVICE_STATE) {
|
||||
return WindowAreaComponent.STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
if (mRearDisplaySessionStatus == WindowAreaComponent.SESSION_STATE_ACTIVE
|
||||
|| !ArrayUtils.contains(mCurrentSupportedDeviceStates, mRearDisplayState)
|
||||
|| isRearDisplayActive()) {
|
||||
@@ -441,6 +447,10 @@ public class WindowAreaComponentImpl implements WindowAreaComponent,
|
||||
|
||||
@GuardedBy("mLock")
|
||||
private int getCurrentRearDisplayPresentationModeStatus() {
|
||||
if (mConcurrentDisplayState == INVALID_DEVICE_STATE) {
|
||||
return WindowAreaComponent.STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
if (mCurrentDeviceState == mConcurrentDisplayState
|
||||
|| !ArrayUtils.contains(mCurrentSupportedDeviceStates, mConcurrentDisplayState)
|
||||
|| isDeviceFolded()) {
|
||||
|
||||
Reference in New Issue
Block a user