Pass WindowContext to DisplayInfoChangeListener

- WindowContext (or updated DisplayContext for Pre-S) contains updated Resources to be used for the listener

Fixes: 181215299
Fixes: 176656141
Test: Swap between large/small screen, large sreen UI is seen
Test: Swap between font size, launcher icon text is updated
Test: Start secondary home
Test: Repeat the above tests with Utilities.ATLEAST_S hardcoded to false
Change-Id: Ib33025ac0276c84fe2b3213e9946721e5988e3da
This commit is contained in:
Alex Chau committed 2021-04-23 19:14:20 +01:00
1 parent baf00e4e55
commit fd6d942220
6 files changed
+28 -22

No files matched your search

@@ -225,7 +225,7 @@ public class RotationTouchHelper implements
public void onNavigationModeChanged(SysUINavigationMode.Mode newMode) {
mDisplayController.removeChangeListener(this);
mDisplayController.addChangeListener(this);
onDisplayInfoChanged(mDisplayController.getInfo(), CHANGE_ALL);
onDisplayInfoChanged(mContext, mDisplayController.getInfo(), CHANGE_ALL);
mOrientationTouchTransformer.setNavigationMode(newMode, mDisplayController.getInfo(),
mContext.getResources());
@@ -243,7 +243,7 @@ public class RotationTouchHelper implements
}
@Override
public void onDisplayInfoChanged(Info info, int flags) {
public void onDisplayInfoChanged(Context context, Info info, int flags) {
if (info.id != mDisplayId|| flags == CHANGE_FRAME_DELAY) {
// ignore displays that aren't running launcher and frame refresh rate changes
return;