Fix violation in DecorContext

The issue happens when activity is launched on the secondary
display. It's because the base context of DecorContext is
a DisplayContext, but we should check #isConfigurationContext in
associatd window's Context instead, like DecorContext#isUiContext

fixes: 242571036
Test: manual - launch activity on the secondary display

Change-Id: Ie2659fb31248ad64099018bfebb6a6b43c72f466
This commit is contained in:
Charles Chen
2022-08-16 10:09:48 +08:00
parent 4947508620
commit 1779ab1e5d

View File

@@ -137,4 +137,13 @@ public class DecorContext extends ContextThemeWrapper {
}
return false;
}
@Override
public boolean isConfigurationContext() {
Context context = mContext.get();
if (context != null) {
return context.isConfigurationContext();
}
return false;
}
}