From 7cf0bde8d1ac11261693629e1bc4190e68c9bf99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 11 Jul 2024 16:06:07 +0900 Subject: [PATCH] =?UTF-8?q?=E5=BE=85=E6=A9=9F=E6=99=82=E9=96=93=E3=82=92?= =?UTF-8?q?=E5=AE=9A=E6=95=B0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/example/childguard/TestService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/example/childguard/TestService.java b/app/src/main/java/com/example/childguard/TestService.java index eae449c..029507b 100644 --- a/app/src/main/java/com/example/childguard/TestService.java +++ b/app/src/main/java/com/example/childguard/TestService.java @@ -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) {