Prevent crashing when disabling MCU during dream wakeup

AmbientMode attempting to send message to DozeHardware no longer results in an
uncaught IllegalStateException.  The exception was crashing Android Wear when
DozeHardware had already been released by PowerManagementService at time of
AmbientMode's message.

Change-Id: I5956a453802b5b764e88638f6b6d899cbc94cc8d
This commit is contained in:
Heather Lee Wilson
2014-05-05 14:22:50 -07:00
parent 84aaf124b7
commit 9da8301e0a

View File

@@ -642,8 +642,9 @@ public final class DreamManagerService extends SystemService {
try {
synchronized (mMcuHal) {
if (mReleased) {
throw new IllegalStateException("This operation cannot be performed "
+ "because the dream has ended.");
Slog.w(TAG, "Ignoring message to MCU HAL because the dream "
+ "has already ended: " + msg);
return null;
}
return mMcuHal.sendMessage(msg, arg);
}