소스 검색

[监控][修改]:调整服务前台化的位置

tags/jenkins-front-end-screenad-242-v139
hupeng 5 년 전
부모
커밋
0787c492a2
1개의 변경된 파일8개의 추가작업 그리고 8개의 파일을 삭제
  1. +8
    -8
      android/app/src/main/java/com/screenad/DaemonService.java

+ 8
- 8
android/app/src/main/java/com/screenad/DaemonService.java 파일 보기

@@ -43,10 +43,15 @@ public class DaemonService extends Service {
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
log("created");
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
log("started");
//利用 Android 漏洞提高进程优先级, 前台进程 //利用 Android 漏洞提高进程优先级, 前台进程
String CHANNEL_ONE_ID = "CHANNEL_ONE_ID";
String CHANNEL_ONE_NAME= "CHANNEL_ONE_ID";
String CHANNEL_ONE_ID = "DaemonService";
String CHANNEL_ONE_NAME= "DaemonService";
NotificationChannel notificationChannel= null; NotificationChannel notificationChannel= null;
//进行8.0的判断 //进行8.0的判断
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
@@ -64,11 +69,6 @@ public class DaemonService extends Service {
notification.flags|= Notification.FLAG_NO_CLEAR; notification.flags|= Notification.FLAG_NO_CLEAR;
startForeground(CORE_SERVICE_ID, notification); startForeground(CORE_SERVICE_ID, notification);
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
log("started");
executorService.submit(new Runnable() { executorService.submit(new Runnable() {
@Override @Override
public void run() { public void run() {


불러오는 중...
취소
저장