Fix NPE in getCompatibleMagnificationSpecForWindow

The commit 179a6b0 forgot to change the returned result.

Note that if the "spec" is non-null, the old code will
cause the source spec of DisplayMagnifier to be cumulatively
multiplied and then become infinite scale.

Bug: 180050756
Test: Enable compat scale and TalkBack
Change-Id: I5a647d4129165021054631461fb97aef61def390
This commit is contained in:
Riddle Hsu
2021-02-12 20:07:43 +08:00
parent 224e5f0b31
commit 30869024f9

View File

@@ -7531,8 +7531,8 @@ public class WindowManagerService extends IWindowManager.Stub
if (spec != null) {
result.setTo(spec);
}
spec.scale *= windowState.mGlobalScale;
return spec;
result.scale *= windowState.mGlobalScale;
return result;
}
}