待機時間を定数化

This commit is contained in:
ろむねこ 2024-07-11 16:06:07 +09:00
parent 85811b7bd0
commit 7cf0bde8d1
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168

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) {