@Test public void testShouldFormatTimeCorrectly() throws Exception { assertEquals("2m 20s", millisToMinutesAndSeconds(140 * 1000L)); assertEquals("1m 1s", millisToMinutesAndSeconds(61 * 1000L)); }
@Nonnull static String millisToMinutesAndSeconds(long millis) { final long seconds = (millis / 1000L) % 60L; final long minutes = (millis / 1000L) / 60L; return String.format("%dm %ds", minutes, seconds); }
SmsAccountConnection extends BaseAccountConnection<SmsAccount> { @Nonnull static String millisToMinutesAndSeconds(long millis) { final long seconds = (millis / 1000L) % 60L; final long minutes = (millis / 1000L) / 60L; return String.format("%dm %ds", minutes, seconds); } }
SmsAccountConnection extends BaseAccountConnection<SmsAccount> { @Nonnull static String millisToMinutesAndSeconds(long millis) { final long seconds = (millis / 1000L) % 60L; final long minutes = (millis / 1000L) / 60L; return String.format("%dm %ds", minutes, seconds); } SmsAccountConnection(@Nonnull SmsAccount account, @Nonnull Context context); }
SmsAccountConnection extends BaseAccountConnection<SmsAccount> { @Nonnull static String millisToMinutesAndSeconds(long millis) { final long seconds = (millis / 1000L) % 60L; final long minutes = (millis / 1000L) / 60L; return String.format("%dm %ds", minutes, seconds); } SmsAccountConnection(@Nonnull SmsAccount account, @Nonnull Context context); void setCallFromUs(@Nonnull String number); @Nonnull ReportsBroadcastReceiver getReceiver(); @Nonnull User findOrCreateContact(@Nonnull final String phone, @Nonnull List<User> contacts); }
SmsAccountConnection extends BaseAccountConnection<SmsAccount> { @Nonnull static String millisToMinutesAndSeconds(long millis) { final long seconds = (millis / 1000L) % 60L; final long minutes = (millis / 1000L) / 60L; return String.format("%dm %ds", minutes, seconds); } SmsAccountConnection(@Nonnull SmsAccount account, @Nonnull Context context); void setCallFromUs(@Nonnull String number); @Nonnull ReportsBroadcastReceiver getReceiver(); @Nonnull User findOrCreateContact(@Nonnull final String phone, @Nonnull List<User> contacts);  }