diff options
| -rw-r--r-- | core/java/android/app/ContextImpl.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index 240dbe1eea24..8803cf263e38 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -3053,8 +3053,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 |