lockscreen notifications: fix expand/clearall button behavior

also fix an NPE and some other minor code cleanups for efficiency

Change-Id: Id220d077ee6fea57e076c36f181e6acde7eb6d81