@Override public synchronized void onPipelineActivated() { mWakeLocker.acquireWakeLock(); moveToForeground(); if(mVehicleInterface != null && mVehicleInterface.isConnected()) { VehicleInterfaceDescriptor descriptor = new VehicleInterfaceDescriptor(mVehicleInterface); synchronized(mViConnectionListeners) { int i = mViConnectionListeners.beginBroadcast(); while(i > 0) { i--; try { mViConnectionListeners.getBroadcastItem(i).onConnected(descriptor); } catch(RemoteException e) { Log.w(TAG, "Couldn't notify VI connection " + "listener -- did it crash?", e); } } mViConnectionListeners.finishBroadcast(); } } }