title: NotificationListenerService not connecting to notification manager
body: <p>I'm having trouble creating a service which extends <code>android.service.notification.NotificationListenerService</code></p>
  
  <p>As per <a href="https://developer.android.com/reference/android/service/notification/NotificationListenerService.html" rel="nofollow">https://developer.android.com/reference/android/service/notification/NotificationListenerService.html</a> I have added the following to the manifest:</p>
  
  <pre><code>&lt;service android:name=".NotificationListener"
   android:label="@string/service_name"
   android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.service.notification.NotificationListenerService" /&gt;
          &lt;/intent-filter&gt;
  &lt;/service&gt;
  </code></pre>
  
  <p>I override <code>Service#onStartCommand</code>:</p>
  
  <pre><code>@Override
  public int onStartCommand(Intent intent, int flags, int startId) {
      Log.d(TAG, "Got onStartCommand");
      return super.onStartCommand(intent, flags, startId);
  }
  </code></pre>
  
  <p>and <code>NotificationListenerService#onListenerConnected</code>:</p>
  
  <pre><code>@Override
  public void onListenerConnected() {
      Log.d(TAG, "Got onListenerConnected");
  }
  </code></pre>
  
  <p>When I run, though, starting the service with an explicit intent, I see that <code>onStartCommand</code> runs but not <code>onListenerConnected</code>. If I try and run <code>requestInterruptionFilter(NotificationListenerService.INTERRUPTION_FILTER_NONE)</code>, from <code>onStartCommand</code> (which is what I want to do) I get <code>W/NotificationListenerService[NotificationListener]: Notification listener service not yet bound.</code></p>
  
  <p>Any idea why I'm not getting <code>onListenerConnected ()</code> (and thus can't send <code>requestInterruptionFilter</code>)?</p>
  
  <p>This is on Lollipop 5.1.1 on Xperia Z1 compact.</p>