Merge "Only notify listeners if device Id changed"

This commit is contained in:
Marco Loaiza
2023-01-12 17:59:09 +00:00
committed by Android (Google) Code Review

View File

@@ -3048,8 +3048,11 @@ class ContextImpl extends Context {
throw new UnsupportedOperationException(
"Cannot update device ID on a Context created with createDeviceContext()");
}
mDeviceId = updatedDeviceId;
notifyOnDeviceChangedListeners(updatedDeviceId);
if (mDeviceId != updatedDeviceId) {
mDeviceId = updatedDeviceId;
notifyOnDeviceChangedListeners(updatedDeviceId);
}
}
@Override