@Test public void disconnectionHandlerIsInvoked() { goro.bind(); assertBinding(); goro.onServiceDisconnected(new ComponentName("test", "test")); verify(disconnection).onServiceDisconnected(goro); }
@Override public void onServiceDisconnected(final ComponentName name) { if (updateDelegate(null)) { /* It's the case when service was stopped by a system server. It can happen when user presses a stop button in application settings (in running apps section). Sometimes this happens on application update. */ if (disconnectionHandler == null) { bind(); } else { disconnectionHandler.onServiceDisconnected(this); } } }