Merge "Fix WindowContextTests" into rvc-dev
This commit is contained in:
@@ -67,13 +67,11 @@ public class WindowTokenClient extends IWindowToken.Stub {
|
|||||||
}
|
}
|
||||||
final int currentDisplayId = context.getDisplayId();
|
final int currentDisplayId = context.getDisplayId();
|
||||||
final boolean displayChanged = newDisplayId != currentDisplayId;
|
final boolean displayChanged = newDisplayId != currentDisplayId;
|
||||||
final Configuration config = new Configuration(context.getResources()
|
final Configuration config = context.getResources().getConfiguration();
|
||||||
.getConfiguration());
|
final boolean configChanged = config.diff(newConfig) != 0;
|
||||||
final boolean configChanged = config.isOtherSeqNewer(newConfig)
|
|
||||||
&& config.updateFrom(newConfig) != 0;
|
|
||||||
if (displayChanged || configChanged) {
|
if (displayChanged || configChanged) {
|
||||||
// TODO(ag/9789103): update resource manager logic to track non-activity tokens
|
// TODO(ag/9789103): update resource manager logic to track non-activity tokens
|
||||||
mResourcesManager.updateResourcesForActivity(this, config, newDisplayId,
|
mResourcesManager.updateResourcesForActivity(this, newConfig, newDisplayId,
|
||||||
displayChanged);
|
displayChanged);
|
||||||
}
|
}
|
||||||
if (displayChanged) {
|
if (displayChanged) {
|
||||||
|
|||||||
@@ -422,14 +422,17 @@ class WindowToken extends WindowContainer<WindowState> {
|
|||||||
if (!shouldReportToClient()) {
|
if (!shouldReportToClient()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (mLastReportedConfig == null) {
|
||||||
|
mLastReportedConfig = new Configuration();
|
||||||
|
}
|
||||||
final Configuration config = getConfiguration();
|
final Configuration config = getConfiguration();
|
||||||
final int displayId = getDisplayContent().getDisplayId();
|
final int displayId = getDisplayContent().getDisplayId();
|
||||||
if (config.equals(mLastReportedConfig) && displayId == mLastReportedDisplay) {
|
if (config.diff(mLastReportedConfig) == 0 && displayId == mLastReportedDisplay) {
|
||||||
// No changes since last reported time.
|
// No changes since last reported time.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mLastReportedConfig = config;
|
mLastReportedConfig.setTo(config);
|
||||||
mLastReportedDisplay = displayId;
|
mLastReportedDisplay = displayId;
|
||||||
|
|
||||||
IWindowToken windowTokenClient = IWindowToken.Stub.asInterface(token);
|
IWindowToken windowTokenClient = IWindowToken.Stub.asInterface(token);
|
||||||
|
|||||||
Reference in New Issue
Block a user