Fix crash due to null uri in ContentObserver.onChange
Also make sure we don't respond to unrecognized changes.
bug: 27291666
Change-Id: I110445231d15427e1fe9e225ed0520af262f740e
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 57dc97a..22f0887 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -646,17 +646,24 @@
@Override
public void onChange(boolean selfChange, Uri uri) {
+ if (uri == null) {
+ return;
+ }
+
if (mDisplayInversionEnabledUri.equals(uri)) {
updateCircularDisplayMaskIfNeeded();
} else {
@UpdateAnimationScaleMode
final int mode;
- if (uri.equals(mWindowAnimationScaleUri)) {
+ if (mWindowAnimationScaleUri.equals(uri)) {
mode = WINDOW_ANIMATION_SCALE;
- } else if (uri.equals(mTransitionAnimationScaleUri)) {
+ } else if (mTransitionAnimationScaleUri.equals(uri)) {
mode = TRANSITION_ANIMATION_SCALE;
- } else { // uri.equals(mAnimationDurationScaleUri)
+ } else if (mAnimationDurationScaleUri.equals(uri)) {
mode = ANIMATION_DURATION_SCALE;
+ } else {
+ // Ignoring unrecognized content changes
+ return;
}
Message m = mH.obtainMessage(H.UPDATE_ANIMATION_SCALE, mode, 0);
mH.sendMessage(m);