Drop notification from service
diff --git a/app/src/main/java/com/libremobileos/facedetect/FaceDetectService.java b/app/src/main/java/com/libremobileos/facedetect/FaceDetectService.java
index 9ea8d07..0185216 100644
--- a/app/src/main/java/com/libremobileos/facedetect/FaceDetectService.java
+++ b/app/src/main/java/com/libremobileos/facedetect/FaceDetectService.java
@@ -2,9 +2,6 @@
import static android.os.Process.THREAD_PRIORITY_FOREGROUND;
-import android.app.Notification;
-import android.app.NotificationChannel;
-import android.app.NotificationManager;
import android.app.Service;
import android.content.om.IOverlayManager;
import android.content.Context;
@@ -400,17 +397,6 @@
} catch (RemoteException e) {
e.printStackTrace();
}
-
- // Create the Foreground Service
- NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
- String channelId = createNotificationChannel(notificationManager);
- Notification.Builder notificationBuilder = new Notification.Builder(this, channelId);
- Notification notification = notificationBuilder.setOngoing(true)
- .setSmallIcon(R.mipmap.ic_launcher)
- .setCategory(Notification.CATEGORY_SERVICE)
- .build();
-
- startForeground(101, notification);
}
private final IFaceDetectService.Stub binder = new IFaceDetectService.Stub() {
@@ -438,15 +424,4 @@
public IBinder onBind(Intent intent) {
return binder;
}
-
- private String createNotificationChannel(NotificationManager notificationManager){
- String channelId = "my_service_channelid";
- String channelName = "My Foreground Service";
- NotificationChannel channel = new NotificationChannel(channelId, channelName, NotificationManager.IMPORTANCE_HIGH);
- // omitted the LED color
- channel.setImportance(NotificationManager.IMPORTANCE_NONE);
- channel.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
- notificationManager.createNotificationChannel(channel);
- return channelId;
- }
}