public void waitUntilBound ( ) throws VehicleServiceException { mRemoteBoundLock . lock ( ) ; Log . i ( TAG , "Waiting for the VehicleService to bind to " + this ) ; while ( mRemoteService == null ) { try { if ( ! mRemoteBoundCondition . await ( 3 , TimeUnit . SECONDS ) ) { throw new VehicleServiceException ( "Not bound to remote service after 3 seconds" ) ; } } catch ( InterruptedException e ) { } } Log . i ( TAG , mRemoteService + " is now bound" ) ; mRemoteBoundLock . unlock ( ) ; }
Block until the VehicleManager is alive and can return measurements .