本文整理匯總了Java中com.eveningoutpost.dexdrip.Models.UserError.last方法的典型用法代碼示例。如果您正苦於以下問題:Java UserError.last方法的具體用法?Java UserError.last怎麽用?Java UserError.last使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.eveningoutpost.dexdrip.Models.UserError
的用法示例。
在下文中一共展示了UserError.last方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isSafeToDeleteDB
import com.eveningoutpost.dexdrip.Models.UserError; //導入方法依賴的package包/類
private boolean isSafeToDeleteDB() {//TODO remove once confirm not needed
TransmitterData last_bg = TransmitterData.last();
if (last_bg != null && last_send_previous <= last_bg.timestamp) {
Log.d(TAG, "onDataChanged SYNC_DB_PATH requestData for last_send_previous < last_bg.timestamp:" + JoH.dateTimeText(last_send_previous) + "<="+ JoH.dateTimeText(last_bg.timestamp));
requestData();
return false;
}
if (mPrefs.getBoolean("sync_wear_logs", false)) {
UserError last_log = UserError.last();
if (last_log != null && last_send_previous_log <= last_log.timestamp) {
Log.d(TAG, "onDataChanged SYNC_DB_PATH requestData for last_send_previous_log < last_log.timestamp:" + JoH.dateTimeText(last_send_previous_log) + "<=" + JoH.dateTimeText((long) last_log.timestamp));
return false;
}
}
return true;
}
示例2: getWearLogData
import com.eveningoutpost.dexdrip.Models.UserError; //導入方法依賴的package包/類
private synchronized DataMap getWearLogData(int count, long last_send_time, int min_count, long syncLogsRequested) {
forceGoogleApiConnect();
Log.d(TAG, "getWearLogData last_send_time:" + JoH.dateTimeText(last_send_time) + " max count=" + count + " min_count=" + min_count + " syncLogsRequested=" + syncLogsRequested);
UserError last_log = UserError.last();
if (last_log != null) {
Log.d(TAG, "getWearLogData last_log.timestamp:" + JoH.dateTimeText((long) last_log.timestamp));
}
if (last_log != null && last_send_time <= last_log.timestamp) {//startTime
long last_send_success = last_send_time;
Log.d(TAG, "getWearLogData last_send_time < last_bg.timestamp:" + JoH.dateTimeText((long) last_log.timestamp));
List<UserError> logs = UserError.latestAsc(count, last_send_time);
if (!logs.isEmpty() && logs.size() > min_count) {
//Log.d(TAG, "getWearLogData count = " + logs.size());
DataMap entries = dataMap(last_log);
final ArrayList<DataMap> dataMaps = new ArrayList<>(logs.size());
for (UserError log : logs) {
dataMaps.add(dataMap(log));
last_send_success = (long)log.timestamp;
//Log.d(TAG, "getWearLogData set last_send_sucess:" + JoH.dateTimeText(last_send_sucess) + " Log:" + log.toString());
}
entries.putLong("time", new Date().getTime()); // MOST IMPORTANT LINE FOR TIMESTAMP
entries.putLong("syncLogsRequested", syncLogsRequested);
entries.putDataMapArrayList("entries", dataMaps);
Log.i(TAG, "getWearLogData SYNCED logs up to " + JoH.dateTimeText(last_send_success) + " count = " + logs.size() + " syncLogsRequested=" + syncLogsRequested);
return entries;
} else
Log.i(TAG, "getWearLogData SYNCED logs up to " + JoH.dateTimeText(last_send_success) + " count = 0" + " syncLogsRequested=" + syncLogsRequested);
}
return null;
}