TestServiceの全体的なリファクタリング #28
@ -270,12 +270,9 @@ public class TestService extends Service {
 | 
				
			|||||||
            boolean isInCar = pref.getBoolean("isInCarPref", false);
 | 
					            boolean isInCar = pref.getBoolean("isInCarPref", false);
 | 
				
			||||||
            if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action) && !isInCar) {
 | 
					            if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action) && !isInCar) {
 | 
				
			||||||
                // bluetoothが切断されたときに乗車状態のとき
 | 
					                // bluetoothが切断されたときに乗車状態のとき
 | 
				
			||||||
                notificationRunnable = new Runnable() {
 | 
					                notificationRunnable = () -> {
 | 
				
			||||||
                    @Override
 | 
					                    // 5分経過した時点でも車に乗っていない場合
 | 
				
			||||||
                    public void run() {
 | 
					                    Notification(context, BLUETOOTH_NOTIFICATION);
 | 
				
			||||||
                        // 5分経過した時点でも車に乗っていない場合
 | 
					 | 
				
			||||||
                        Notification(context, BLUETOOTH_NOTIFICATION);
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                };
 | 
					                };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                handler.postDelayed(notificationRunnable, 5 * 60 * 1000); // 5分をミリ秒に変換
 | 
					                handler.postDelayed(notificationRunnable, 5 * 60 * 1000); // 5分をミリ秒に変換
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user