@Test @Config(sdk = 17) public void getTimeInNanos_shouldReturnElapsedRealtimeNanosForSdk17AndUp() throws Exception { final long nanos = 1000000; final Location location = new Location("mock"); location.setElapsedRealtimeNanos(nanos); assertThat(clock.getElapsedTimeInNanos(location)).isEqualTo(nanos); }
@Override public long getElapsedTimeInNanos(Location location) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { return location.getElapsedRealtimeNanos(); } return location.getTime() * MS_TO_NS; }
SystemClock implements Clock { @Override public long getElapsedTimeInNanos(Location location) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { return location.getElapsedRealtimeNanos(); } return location.getTime() * MS_TO_NS; } }
SystemClock implements Clock { @Override public long getElapsedTimeInNanos(Location location) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { return location.getElapsedRealtimeNanos(); } return location.getTime() * MS_TO_NS; }  }
SystemClock implements Clock { @Override public long getElapsedTimeInNanos(Location location) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { return location.getElapsedRealtimeNanos(); } return location.getTime() * MS_TO_NS; }  @Override long getSystemElapsedTimeInNanos(); @Override long getElapsedTimeInNanos(Location location); }
SystemClock implements Clock { @Override public long getElapsedTimeInNanos(Location location) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { return location.getElapsedRealtimeNanos(); } return location.getTime() * MS_TO_NS; }  @Override long getSystemElapsedTimeInNanos(); @Override long getElapsedTimeInNanos(Location location);  }