There might having windowless dream service like doze dream which won't hava attached activity, so call finish() directly in onWakeUp() since finish() itself deals with finishAndRemoveTask() as well. Fix: b/150110220 Test: manual test, won't throw NPE while leaving doze service. Change-Id: I982c2f6fb1859e869732ef8795b61bf96e8cff64