TestServiceの全体的なリファクタリング #28

Merged
asura146 merged 73 commits from improve/refactor_service into main 2024-07-12 02:17:26 +00:00
Showing only changes of commit 7cf0bde8d1 - Show all commits

View File

@ -52,6 +52,7 @@ public class TestService extends Service {
public static final String TAG = "InspirationQuote";
private static final String CHANNEL_ID = "child_guard_emergency";
private static final int REQUEST_CODE = 100;
private static final int NOTIFICATION_DELAY = 5 * 60 * 1000; // 5 minutes
private static final NotificationContent REPORTED_NOTIFICATION =
new NotificationContent("子供の置き去りをしていませんか?", "第三者からの通報が行われました。");
private static final NotificationContent BLUETOOTH_NOTIFICATION =
@ -280,7 +281,7 @@ public class TestService extends Service {
// 5分経過した時点でも車に乗っていない場合
sendNotification(context, BLUETOOTH_NOTIFICATION);
};
handler.postDelayed(notificationRunnable, 5 * 60 * 1000); // 5分をミリ秒に変換
handler.postDelayed(notificationRunnable, NOTIFICATION_DELAY);
} else if (BluetoothDevice.ACTION_ACL_CONNECTED.equals(action)) {
// 再接続された場合通知をキャンセルする
if (notificationRunnable != null) {