Merge "Use HwLight.type as the key of mLightsByType"

This commit is contained in:
Treehugger Robot
2023-06-19 09:44:58 +00:00
committed by Gerrit Code Review

View File

@@ -465,9 +465,10 @@ public class LightsService extends SystemService {
} }
for (int i = mLightsById.size() - 1; i >= 0; i--) { for (int i = mLightsById.size() - 1; i >= 0; i--) {
final int type = mLightsById.keyAt(i); LightImpl light = mLightsById.valueAt(i);
final int type = light.mHwLight.type;
if (0 <= type && type < mLightsByType.length) { if (0 <= type && type < mLightsByType.length) {
mLightsByType[type] = mLightsById.valueAt(i); mLightsByType[type] = light;
} }
} }
} }