diff --git a/app/build.gradle b/app/build.gradle
index dab9c687b..09d98157e 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -69,6 +69,7 @@ dependencies {
implementation project(':catvod')
implementation project(':forcetech')
implementation project(':ijkplayer')
+ pythonImplementation project(':pyramid')
implementation project(':media-lib-database')
implementation project(':media-lib-datasource')
implementation project(':media-lib-datasource-rtmp')
@@ -82,7 +83,6 @@ dependencies {
implementation project(':media-lib-extractor')
implementation project(':media-lib-session')
implementation project(':media-lib-ui')
- pythonImplementation project(':pyramid')
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.5.1'
implementation 'androidx.preference:preference:1.2.0'
diff --git a/app/src/leanback/AndroidManifest.xml b/app/src/leanback/AndroidManifest.xml
index 7a20a9241..8ec608c1d 100644
--- a/app/src/leanback/AndroidManifest.xml
+++ b/app/src/leanback/AndroidManifest.xml
@@ -15,8 +15,6 @@
android:required="false" />
-
-
@@ -82,22 +80,5 @@
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
android:screenOrientation="sensorLandscape" />
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/leanback/java/com/fongmi/android/tv/receiver/BootReceiver.java b/app/src/leanback/java/com/fongmi/android/tv/receiver/BootReceiver.java
deleted file mode 100644
index 12b1c93b1..000000000
--- a/app/src/leanback/java/com/fongmi/android/tv/receiver/BootReceiver.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.fongmi.android.tv.receiver;
-
-import android.annotation.SuppressLint;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-
-import com.fongmi.android.tv.service.NanoService;
-
-public class BootReceiver extends BroadcastReceiver {
-
- @Override
- @SuppressLint("UnsafeProtectedBroadcastReceiver")
- public void onReceive(Context context, Intent intent) {
- NanoService.start();
- }
-}
diff --git a/app/src/leanback/java/com/fongmi/android/tv/service/NanoService.java b/app/src/leanback/java/com/fongmi/android/tv/service/NanoService.java
deleted file mode 100644
index fff6b84b5..000000000
--- a/app/src/leanback/java/com/fongmi/android/tv/service/NanoService.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.fongmi.android.tv.service;
-
-import android.app.Notification;
-import android.app.NotificationChannel;
-import android.app.NotificationManager;
-import android.app.Service;
-import android.content.Context;
-import android.content.Intent;
-import android.os.Build;
-import android.os.IBinder;
-
-import androidx.annotation.Nullable;
-import androidx.core.content.ContextCompat;
-
-import com.fongmi.android.tv.App;
-import com.fongmi.android.tv.BuildConfig;
-import com.fongmi.android.tv.R;
-import com.fongmi.android.tv.server.Server;
-
-public class NanoService extends Service {
-
- public static void start() {
- ContextCompat.startForegroundService(App.get(), new Intent(App.get(), NanoService.class));
- }
-
- @Override
- public void onCreate() {
- super.onCreate();
- Server.get().start();
- }
-
- @Override
- public int onStartCommand(Intent intent, int flags, int startId) {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) return START_STICKY;
- NotificationChannel channel = new NotificationChannel(BuildConfig.FLAVOR_mode, getString(R.string.app_name), NotificationManager.IMPORTANCE_DEFAULT);
- ((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE)).createNotificationChannel(channel);
- Notification notify = new Notification.Builder(this, BuildConfig.FLAVOR_mode).build();
- startForeground(1, notify);
- return START_STICKY;
- }
-
- @Nullable
- @Override
- public IBinder onBind(Intent intent) {
- return null;
- }
-
- @Override
- public void onDestroy() {
- super.onDestroy();
- Server.get().stop();
- }
-}
diff --git a/app/src/leanback/java/com/fongmi/android/tv/ui/activity/HomeActivity.java b/app/src/leanback/java/com/fongmi/android/tv/ui/activity/HomeActivity.java
index c104ceb82..d8d648dee 100644
--- a/app/src/leanback/java/com/fongmi/android/tv/ui/activity/HomeActivity.java
+++ b/app/src/leanback/java/com/fongmi/android/tv/ui/activity/HomeActivity.java
@@ -30,7 +30,7 @@ import com.fongmi.android.tv.event.RefreshEvent;
import com.fongmi.android.tv.event.ServerEvent;
import com.fongmi.android.tv.model.SiteViewModel;
import com.fongmi.android.tv.net.Callback;
-import com.fongmi.android.tv.service.NanoService;
+import com.fongmi.android.tv.server.Server;
import com.fongmi.android.tv.ui.base.BaseActivity;
import com.fongmi.android.tv.ui.custom.CustomRowPresenter;
import com.fongmi.android.tv.ui.custom.CustomSelector;
@@ -71,7 +71,7 @@ public class HomeActivity extends BaseActivity implements CustomTitleView.Listen
protected void initView() {
mBinding.progressLayout.showProgress();
Updater.get().start();
- NanoService.start();
+ Server.get().start();
setRecyclerView();
setViewModel();
setAdapter();
@@ -350,5 +350,6 @@ public class HomeActivity extends BaseActivity implements CustomTitleView.Listen
WallConfig.get().clear();
LiveConfig.get().clear();
ApiConfig.get().clear();
+ Server.get().stop();
}
}
\ No newline at end of file