提出段階のver

This commit is contained in:
it232115 2024-01-23 09:29:42 +09:00
parent 75b4be9ff1
commit 235afb92cb
2 changed files with 22 additions and 28 deletions

View File

@ -158,6 +158,7 @@ public class TestService extends Service {
}
notificationManager.notify(R.string.app_name, builder.build());//通知の表示
}
public void NotificationBluetooth(Context context) {//実際に通知を行うメソッド
final String CHANNEL_ID = "my_channel_id";
// 通知がクリックされたときに送信されるIntent
@ -206,10 +207,6 @@ public class TestService extends Service {
}
public void Bluetooth_status() {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(BluetoothDevice.ACTION_ACL_CONNECTED);
@ -253,7 +250,6 @@ public class TestService extends Service {
Log.d("BT", "Device connected");
Log.d("BT_Judge", "Registered: " + registeredId);
if (deviceHardwareAddress.equals(registeredId)) {
@ -280,7 +276,8 @@ public class TestService extends Service {
public void run() {
if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action) && !isInCar) {//その後bluetoothを再接続したり降車状態になったりしていない置き去りが発生した可能性大
NotificationBluetooth(getApplicationContext());//通知を行うメソッド
}}
}
}
}, 5 * 60 * 1000); // 5分をミリ秒に変換
}
@ -291,9 +288,6 @@ public class TestService extends Service {
};
@Nullable
@Override
public IBinder onBind(Intent intent) {