From b66a16d9751d5e0f2b6816367e7d8919d707c692 Mon Sep 17 00:00:00 2001 From: Chris Wren Date: Fri, 29 Apr 2016 10:07:48 -0400 Subject: [PATCH] close a potential race condition in registerAsSystemService Bug: 27555424 Change-Id: I1537fd1aae3dba83de22d1b245bddd0a3922d289 --- .../service/notification/NotificationListenerService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java index e708b0ad5aff0..cf783d25251e6 100644 --- a/core/java/android/service/notification/NotificationListenerService.java +++ b/core/java/android/service/notification/NotificationListenerService.java @@ -764,9 +764,9 @@ public abstract class NotificationListenerService extends Service { } mSystemContext = context; INotificationManager noMan = getNotificationInterface(); - noMan.registerListener(mWrapper, componentName, currentUser); - mCurrentUser = currentUser; mHandler = new MyHandler(context.getMainLooper()); + mCurrentUser = currentUser; + noMan.registerListener(mWrapper, componentName, currentUser); } /**