Fix NPE in dumpsys window

This crashes with an Android TV without sensor (i.e. TV)

Change-Id: I5e461c6344811686f58860d427598626efdf0184
This commit is contained in:
Jaewan Kim
2014-06-26 09:13:11 +09:00
parent 239d99c4d3
commit 0abc28e114

View File

@@ -193,7 +193,9 @@ public abstract class WindowOrientationListener {
pw.println(prefix + "mSensor=" + mSensor);
pw.println(prefix + "mRate=" + mRate);
mSensorEventListener.dumpLocked(pw, prefix);
if (mSensorEventListener != null) {
mSensorEventListener.dumpLocked(pw, prefix);
}
}
}