Print names of observers causing timeout

Also switched to SynchronousUserSwitchObserver, otherwise onUserSwitching
must notify the reply callback.

Bug: 29039588
Change-Id: I03eb7fbeccf4cc6ece5b5946a634e465ca2717ee
diff --git a/Settings/src/com/android/tv/settings/users/UserSwitchListenerService.java b/Settings/src/com/android/tv/settings/users/UserSwitchListenerService.java
index 5fd7773..af061f3 100644
--- a/Settings/src/com/android/tv/settings/users/UserSwitchListenerService.java
+++ b/Settings/src/com/android/tv/settings/users/UserSwitchListenerService.java
@@ -17,8 +17,8 @@
 package com.android.tv.settings.users;
 
 import android.app.ActivityManagerNative;
-import android.app.IUserSwitchObserver;
 import android.app.Service;
+import android.app.SynchronousUserSwitchObserver;
 import android.content.BroadcastReceiver;
 import android.content.ComponentName;
 import android.content.Context;
@@ -26,7 +26,6 @@
 import android.content.SharedPreferences;
 import android.content.pm.PackageManager;
 import android.os.IBinder;
-import android.os.IRemoteCallback;
 import android.os.RemoteException;
 import android.os.UserHandle;
 import android.os.UserManager;
@@ -110,9 +109,9 @@
         super.onCreate();
         try {
             ActivityManagerNative.getDefault().registerUserSwitchObserver(
-                    new IUserSwitchObserver.Stub() {
+                    new SynchronousUserSwitchObserver() {
                         @Override
-                        public void onUserSwitching(int newUserId, IRemoteCallback reply) {
+                        public void onUserSwitching(int newUserId) throws RemoteException {
                         }
 
                         @Override
@@ -127,7 +126,7 @@
                         public void onForegroundProfileSwitch(int profileId)
                             throws RemoteException {
                         }
-                    });
+                    }, UserSwitchListenerService.class.getName());
         } catch (RemoteException e) {
         }
     }