正在查看: xDrip+ v04633772025.07.16 应用的 DailyIntentService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: xDrip+ v04633772025.07.16 应用的 DailyIntentService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.eveningoutpost.dexdrip.services;
import android.app.AlarmManager;
import android.app.IntentService;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.PowerManager;
import com.eveningoutpost.dexdrip.Home;
import com.eveningoutpost.dexdrip.cloud.backup.Backup;
import com.eveningoutpost.dexdrip.importedlibraries.usbserial.driver.UsbId;
import com.eveningoutpost.dexdrip.models.BgReading;
import com.eveningoutpost.dexdrip.models.DesertSync;
import com.eveningoutpost.dexdrip.models.JoH;
import com.eveningoutpost.dexdrip.models.Libre2RawValue;
import com.eveningoutpost.dexdrip.models.RollCall;
import com.eveningoutpost.dexdrip.models.StepCounter;
import com.eveningoutpost.dexdrip.models.Treatments;
import com.eveningoutpost.dexdrip.models.UserError;
import com.eveningoutpost.dexdrip.utilitymodels.BgSendQueue;
import com.eveningoutpost.dexdrip.utilitymodels.CalibrationSendQueue;
import com.eveningoutpost.dexdrip.utilitymodels.IncompatibleApps;
import com.eveningoutpost.dexdrip.utilitymodels.NightscoutUploader;
import com.eveningoutpost.dexdrip.utilitymodels.Pref;
import com.eveningoutpost.dexdrip.utilitymodels.SettingsValidation;
import com.eveningoutpost.dexdrip.utilitymodels.UpdateActivity;
import com.eveningoutpost.dexdrip.utilitymodels.UploaderQueue;
import com.eveningoutpost.dexdrip.utils.DatabaseUtil;
import com.eveningoutpost.dexdrip.utils.Telemetry;
import com.eveningoutpost.dexdrip.wearintegration.WatchUpdaterService;
import com.eveningoutpost.dexdrip.xdrip;
public class DailyIntentService extends IntentService {
private static final String TAG = "DailyIntentService";
public DailyIntentService() {
super(TAG);
}
@Override
protected void onHandleIntent(Intent intent) {
UserError.Log.wtf(TAG, "CALLED VIA INTENT - cancelling");
cancelSelf();
}
private void cancelSelf() {
try {
((AlarmManager) getSystemService("alarm")).cancel(PendingIntent.getService(xdrip.getAppContext(), 0, new Intent(this, (Class<?>) DailyIntentService.class), 134217728));
} catch (Exception e) {
UserError.Log.wtf(TAG, "Crash in cancelSelf() " + e);
}
}
public static synchronized void work() {
synchronized (DailyIntentService.class) {
PowerManager.WakeLock wakeLock = JoH.getWakeLock(TAG, 120000);
try {
String str = TAG;
UserError.Log.ueh(str, "DailyIntent Service work called");
if (JoH.pratelimit("daily-intent-service", UsbId.SILABS_CP2102)) {
UserError.Log.i(str, "DailyIntentService onHandleIntent Starting");
Long valueOf = Long.valueOf(JoH.tsl());
if (Pref.getBooleanDefaultFalse("save_db_ondemand")) {
try {
DatabaseUtil.saveSql(xdrip.getAppContext(), "daily");
} catch (Exception e) {
UserError.Log.e(TAG, "DailyIntentService exception on Daily Save Database - ", e);
}
}
try {
Backup.doCompleteBackupIfEnabled();
} catch (Exception e2) {
UserError.Log.e(TAG, "Exception with Backup: " + e2);
}
try {
Home.startWatchUpdaterService(xdrip.getAppContext(), WatchUpdaterService.ACTION_SYNC_DB, TAG);
} catch (Exception e3) {
UserError.Log.e(TAG, "DailyIntentService exception on watch clear DB ", e3);
}
try {
UserError.cleanup();
} catch (Exception e4) {
UserError.Log.e(TAG, "DailyIntentService exception on UserError ", e4);
}
try {
BgSendQueue.cleanQueue();
} catch (Exception e5) {
UserError.Log.d(TAG, "DailyIntentService exception on BgSendQueue " + e5);
}
try {
CalibrationSendQueue.cleanQueue();
} catch (Exception e6) {
UserError.Log.d(TAG, "DailyIntentService exception on CalibrationSendQueue " + e6);
}
try {
UploaderQueue.cleanQueue();
} catch (Exception e7) {
UserError.Log.e(TAG, "DailyIntentService exception on UploaderQueue ", e7);
}
try {
StepCounter.cleanup(Pref.getInt("retention_pebble_movement", 180));
} catch (Exception e8) {
UserError.Log.e(TAG, "DailyIntentService exception on PebbleMovement ", e8);
}
try {
int stringToInt = Pref.getStringToInt("retention_days_bg_reading", 0);
if (stringToInt > 0) {
BgReading.cleanup(stringToInt);
try {
Libre2RawValue.cleanup(stringToInt);
} catch (Exception e9) {
UserError.Log.e(TAG, "Exception cleaning up libre raw values " + e9);
}
try {
Treatments.cleanup(stringToInt);
} catch (Exception e10) {
UserError.Log.e(TAG, "Exception cleaning up treatment data " + e10);
}
}
} catch (Exception e11) {
UserError.Log.e(TAG, "DailyIntentService exception on BgReadings cleanup ", e11);
}
try {
BluetoothGlucoseMeter.startIfNoRecentData();
} catch (Exception unused) {
UserError.Log.e(TAG, "DailyIntentService exception on BluetoothGlucoseMeter");
}
try {
UpdateActivity.checkForAnUpdate(xdrip.getAppContext());
} catch (Exception e12) {
UserError.Log.e(TAG, "DailyIntentService exception on checkForAnUpdate ", e12);
}
try {
if (Home.get_master_or_follower()) {
RollCall.pruneOld(0);
}
} catch (Exception e13) {
UserError.Log.e(TAG, "exception on RollCall prune " + e13);
}
try {
DesertSync.cleanup();
} catch (Exception unused2) {
UserError.Log.e(TAG, "Exception cleaning up DesertSync");
}
try {
Telemetry.sendFirmwareReport();
Telemetry.sendCaptureReport();
} catch (Exception e14) {
UserError.Log.e(TAG, "Exception in Telemetry: " + e14);
}
try {
IncompatibleApps.notifyAboutIncompatibleApps();
} catch (Exception unused3) {
}
try {
SettingsValidation.notifyAboutInadvisableSettings();
} catch (Exception e15) {
UserError.Log.e(TAG, "Exception in SettingsValidation: " + e15);
}
try {
NightscoutUploader.notifyInconsistentMultiSiteUpload();
} catch (Exception e16) {
UserError.Log.e(TAG, "Exception in Nightscout multi site upload failure log: " + e16);
}
UserError.Log.i(TAG, "DailyIntentService onHandleIntent exiting after " + ((JoH.tsl() - valueOf.longValue()) / 1000) + " seconds");
}
} finally {
JoH.releaseWakeLock(wakeLock);
}
}
}
}