From 7047502bd791b4f2b0e1538527653ab98ceeea75 Mon Sep 17 00:00:00 2001 From: Candice Date: Thu, 6 Feb 2025 12:20:25 +0000 Subject: Add null check for magnificationSettingsController Since the DisplayIdIndexSupplier#get could return a null controller, we need to check if the controller is null before performing the next steps. Bug: 378043155 Test: atest IMagnificationConnectionTest Flag: EXEMPT bugfix Change-Id: I494e6f0b69c6ef47a71920d5e5e3e115b6c6d2c4 --- .../src/com/android/systemui/accessibility/MagnificationImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationImpl.java b/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationImpl.java index 5482c3d3ea18..115242eb13aa 100644 --- a/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationImpl.java +++ b/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationImpl.java @@ -453,7 +453,9 @@ public class MagnificationImpl implements Magnification, CommandQueue.Callbacks final MagnificationSettingsController magnificationSettingsController = mMagnificationSettingsSupplier.get(displayId); - magnificationSettingsController.setMagnificationScale(scale); + if (magnificationSettingsController != null) { + magnificationSettingsController.setMagnificationScale(scale); + } } @VisibleForTesting -- cgit v1.2.3-59-g8ed1b