待機時間を定数化
This commit is contained in:
parent
85811b7bd0
commit
7cf0bde8d1
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user