Merge "UxRestrictinManager: Do not crash on non-existing port config" into qt-dev am: ed45f3be3a
am: f30cf9a853

Change-Id: Ic082450a9fb242f043e6cbba139b59932c040dc4
diff --git a/service/src/com/android/car/CarUxRestrictionsManagerService.java b/service/src/com/android/car/CarUxRestrictionsManagerService.java
index 38ac562..9a0896f 100644
--- a/service/src/com/android/car/CarUxRestrictionsManagerService.java
+++ b/service/src/com/android/car/CarUxRestrictionsManagerService.java
@@ -705,6 +705,9 @@
         Map<Byte, CarUxRestrictions> newUxRestrictions = new HashMap<>();
         for (byte port : mPhysicalPorts) {
             CarUxRestrictionsConfiguration config = mCarUxRestrictionsConfigurations.get(port);
+            if (config == null) {
+                continue;
+            }
 
             CarUxRestrictions uxRestrictions = config.getUxRestrictions(
                     currentDrivingState, speed, mRestrictionMode);