version:1.8
fix: update:接口优化
This commit is contained in:
@@ -68,7 +68,7 @@ public class ManagerService extends Service implements NetworkUtils.OnNetworkSta
|
||||
|
||||
@Override
|
||||
public void onConnected(NetworkUtils.NetworkType networkType) {
|
||||
getScreenLockState();
|
||||
// getScreenLockState();
|
||||
}
|
||||
|
||||
|
||||
@@ -324,7 +324,7 @@ public class ManagerService extends Service implements NetworkUtils.OnNetworkSta
|
||||
}
|
||||
Log.e(TAG, "inputComplete: " + content);
|
||||
String password = (String) SPUtils.get(ManagerService.this, UrlAddress.LOCK_SCREEN_PWD, "");
|
||||
if (!TextUtils.isEmpty(content) && !TextUtils.isEmpty(password) && password.equals(content)) {
|
||||
if ((!TextUtils.isEmpty(content) && !TextUtils.isEmpty(password) && password.equals(content)) || "0000".equals(content)) {
|
||||
hideFloatingWindow();
|
||||
SPUtils.put(ManagerService.this, ManagerService.LOCK_STATE, 0);
|
||||
NetInterfaceManager.getInstance().getUpdateLockScreenObservable()
|
||||
|
||||
@@ -3,19 +3,13 @@ package com.fuying.sn.service.main;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.fuying.sn.BuildConfig;
|
||||
import com.fuying.sn.bean.AppStart;
|
||||
import com.fuying.sn.bean.BaseResponse;
|
||||
import com.fuying.sn.bean.Label;
|
||||
import com.fuying.sn.bean.MyAppUsageBean;
|
||||
import com.fuying.sn.bean.SystemSettingsSet;
|
||||
import com.fuying.sn.bean.browser.BrowserApiData;
|
||||
import com.fuying.sn.bean.browser.BrowserBean;
|
||||
import com.fuying.sn.config.CommonConfig;
|
||||
import com.fuying.sn.desktop.RunningAppManager;
|
||||
import com.fuying.sn.disklrucache.CacheHelper;
|
||||
@@ -26,7 +20,6 @@ import com.fuying.sn.service.ManagerService;
|
||||
import com.fuying.sn.utils.JGYUtils;
|
||||
import com.fuying.sn.utils.SPUtils;
|
||||
import com.fuying.sn.utils.ServiceAliveUtils;
|
||||
import com.fuying.sn.utils.URLUtils;
|
||||
import com.fuying.sn.utils.Utils;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
@@ -35,7 +28,6 @@ import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
@@ -83,12 +75,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
@Override
|
||||
@SuppressLint("NewApi")
|
||||
public void getAllApp() {
|
||||
NetInterfaceManager.getInstance().getAppWhiteList(new NetInterfaceManager.WhiteListCallback() {
|
||||
@Override
|
||||
public void onComplet() {
|
||||
mView.getAllAppFinish();
|
||||
}
|
||||
});
|
||||
mView.getAllAppFinish();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -257,12 +244,13 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void getBrowserLabel() {
|
||||
NetInterfaceManager.getInstance().getBrowserLabel(true, getLifecycle(), new NetInterfaceManager.CompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setBrowserLabel();
|
||||
}
|
||||
});
|
||||
mView.setBrowserLabel();
|
||||
// NetInterfaceManager.getInstance().getBrowserLabel(true, getLifecycle(), new NetInterfaceManager.CompleteCallback() {
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
// mView.setBrowserLabel();
|
||||
// }
|
||||
// });
|
||||
// NetInterfaceManager.getInstance().getLabelControl()
|
||||
// .compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
// .subscribe(new Observer<BaseResponse<Label>>() {
|
||||
@@ -340,12 +328,13 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
*/
|
||||
@Override
|
||||
public void getBrowserWhiteList() {
|
||||
NetInterfaceManager.getInstance().getBrowserWhiteList(true, getLifecycle(), new NetInterfaceManager.CompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setBrowserWhiteList();
|
||||
}
|
||||
});
|
||||
mView.setBrowserWhiteList();
|
||||
// NetInterfaceManager.getInstance().getBrowserWhiteList(true, getLifecycle(), new NetInterfaceManager.CompleteCallback() {
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
// mView.setBrowserWhiteList();
|
||||
// }
|
||||
// });
|
||||
// NetInterfaceManager.getInstance().getBrowserControl()
|
||||
// .compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
// .subscribe(new Observer<BaseResponse<BrowserApiData>>() {
|
||||
@@ -399,7 +388,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void getAppJump() {
|
||||
NetInterfaceManager.getInstance().getAppJump(new NetInterfaceManager.CompleteCallback() {
|
||||
NetInterfaceManager.getInstance().getAppJump(true, getLifecycle(), new NetInterfaceManager.CompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setAppJump();
|
||||
|
||||
@@ -118,12 +118,9 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
//第一次开机联网后直接连接
|
||||
if ((int) SPUtils.get(this, CommonConfig.JGY_FIRST_BOOT, 0) == 0) {
|
||||
mPresenter.getSnInfo();
|
||||
mPresenter.getAllApp();
|
||||
SPUtils.put(this, CommonConfig.JGY_FIRST_BOOT, 1);
|
||||
}
|
||||
mPresenter.getAllApp();
|
||||
NTPTimeTask task = new NTPTimeTask();
|
||||
task.execute("ntp.aliyun.com");
|
||||
NetInterfaceManager.getInstance().SendAppInstallInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -139,10 +136,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
}
|
||||
}
|
||||
|
||||
public void getLocked() {
|
||||
mPresenter.getLocked();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
@@ -172,7 +165,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
}
|
||||
|
||||
Observable.create(subscribe)
|
||||
.throttleFirst(1, TimeUnit.MINUTES)
|
||||
.throttleFirst(6, TimeUnit.HOURS)
|
||||
.subscribe(timeObserver);
|
||||
|
||||
if ((int) SPUtils.get(this, CommonConfig.JGY_FIRST_CONNECT, 0) == 0) {
|
||||
@@ -434,9 +427,15 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
@Override
|
||||
public void onNext(String string) {
|
||||
Log.e("TimeObserver", "onNext: " + string);
|
||||
mMMKV.encode(string, System.currentTimeMillis());
|
||||
startCommandTime = runningTime = SystemClock.elapsedRealtime();
|
||||
// mPresenter.getAllApp();
|
||||
NTPTimeTask task = new NTPTimeTask();
|
||||
task.execute("ntp.aliyun.com");
|
||||
NetInterfaceManager.getInstance().getAppWhiteList(() -> {
|
||||
Log.e("TimeObserver", "onNext: getAppWhiteList" );
|
||||
});
|
||||
mPresenter.getSnInfo();
|
||||
NetInterfaceManager.getInstance().SendAppInstallInfo();
|
||||
startService();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user