Improve alarm update logic

Change-Id: Ied42eae8ff250d7cfda65d410b6bf2495c21e0f2