Browse Source

Refactor in DetectorService class

bk_video
Bastian Kohler 1 year ago
parent
commit
7dee124378

+ 3
- 9
app/src/main/java/com/example/ueberwachungssystem/Detection/DetectorService.java View File

@@ -1,19 +1,13 @@
package com.example.ueberwachungssystem.Detection;

import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.camera.core.ExperimentalGetImage;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.LifecycleService;

import java.io.File;
@@ -21,7 +15,7 @@ import java.io.File;
@ExperimentalGetImage
public class DetectorService extends LifecycleService {

public TestBinder testBinder = new TestBinder();
public ServiceBinder serviceBinder = new ServiceBinder();
private DetectorService.OnDetectionListener listener;
private boolean isServiceRunning = false;

@@ -56,7 +50,7 @@ public class DetectorService extends LifecycleService {
}

/** Service methods */
public class TestBinder extends Binder {
public class ServiceBinder extends Binder {
public DetectorService getBoundService() {
// Return an instance of the TestService
return DetectorService.this;
@@ -66,7 +60,7 @@ public class DetectorService extends LifecycleService {
@Override
public IBinder onBind(Intent intent) {
super.onBind(intent);
return testBinder;
return serviceBinder;
}



Loading…
Cancel
Save