version:
fix:优化请求次数 update:
This commit is contained in:
@@ -29,7 +29,7 @@ import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.comm.PackageNames;
|
||||
import com.aoleyun.sn.manager.AmapManager;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.aoleyun.sn.network.api.SendScreenStatusApi;
|
||||
import com.aoleyun.sn.network.api.post.SendScreenStatusApi;
|
||||
import com.aoleyun.sn.receiver.BootReceiver;
|
||||
import com.aoleyun.sn.receiver.NewAppReceiver;
|
||||
import com.aoleyun.sn.rlog.LogDBManager;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class MainSContact {
|
||||
/*是否第一次联网*/
|
||||
void getFirstConnect();
|
||||
/*获取学生信息*/
|
||||
void getStudesInfo();
|
||||
void getStudesInfo(boolean refresh);
|
||||
|
||||
/*分支3 上传信息*/
|
||||
/*发送mac地址*/
|
||||
@@ -31,15 +31,8 @@ public class MainSContact {
|
||||
|
||||
/*分支4 获取应用*/
|
||||
/*获取设备信息更新*/
|
||||
void checkInfoUpdate();
|
||||
/*获取应用市场更新*/
|
||||
void checkStoreUpdate();
|
||||
/*获取桌面升级*/
|
||||
void checkDesktopUpdate();
|
||||
/*获取通知升级*/
|
||||
void checkNotifyUpdate();
|
||||
/*获取浏览器升级*/
|
||||
void checkBrowserUpdate();
|
||||
void checkAoleyunUpdate();
|
||||
|
||||
/*获取测试应用更新*/
|
||||
void checkTestUpdate();
|
||||
/*获取强制下载apk*/
|
||||
@@ -111,15 +104,8 @@ public class MainSContact {
|
||||
void sendInstalledFinish();
|
||||
|
||||
/*获取设备信息更新*/
|
||||
void checkInfoUpdateFinish();
|
||||
/*获取应用市场更新*/
|
||||
void checkStoreUpdateFinish();
|
||||
/*获取桌面升级*/
|
||||
void checkDesktopUpdateFinish();
|
||||
/*获取通知升级*/
|
||||
void checkNotifyUpdateFinish();
|
||||
/*获取浏览器升级*/
|
||||
void checkBrowserUpdateFinish();
|
||||
void checkAoleyunUpdateFinish();
|
||||
|
||||
/*获取测试应用更新*/
|
||||
void checkTestUpdateFinish();
|
||||
/*获取强制下载apk结束*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -36,7 +36,6 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.R;
|
||||
import com.aoleyun.sn.activity.SplashActivity;
|
||||
import com.aoleyun.sn.activity.checknet.CheckNetActivity;
|
||||
import com.aoleyun.sn.activity.main.MainAPresenter;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
@@ -119,7 +118,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
}
|
||||
}
|
||||
if (!checkAoleyunApp()) {
|
||||
mPresenter.checkInfoUpdate();
|
||||
mPresenter.checkAoleyunUpdate();
|
||||
}
|
||||
TimeTask task = new TimeTask();
|
||||
task.execute("ntp.aliyun.com");
|
||||
@@ -189,11 +188,8 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
Log.e("TPush", "注册失败,错误码:" + errCode + ",错误信息:" + msg);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private final BehaviorSubject<ActivityEvent> lifecycleSubject = BehaviorSubject.create();
|
||||
|
||||
@Override
|
||||
@@ -303,6 +299,9 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
@Override
|
||||
public void onNext(String string) {
|
||||
connectKey = string;
|
||||
if (!connectKey.equals(ConnectManager.REBOOT_LAST_ONNECT_TIME)) {
|
||||
mMMKV.encode(connectKey, System.currentTimeMillis());
|
||||
}
|
||||
Log.e("timeObserver", "onNext: " + string);
|
||||
mPresenter.getLockedState(string);
|
||||
}
|
||||
@@ -339,6 +338,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
TimeTask task = new TimeTask();
|
||||
task.execute("ntp.aliyun.com");
|
||||
|
||||
//根据要求卸载这两个应用
|
||||
ApkUtils.UninstallAPP(this, "com.joytv.live");
|
||||
ApkUtils.UninstallAPP(this, "com.tencent.android.qqdownloader");
|
||||
|
||||
@@ -370,9 +370,9 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
// if (ConnectManager.getInstance().isRebootFistConnect()) {
|
||||
start.onstar(ConnectManager.REBOOT_LAST_ONNECT_TIME);
|
||||
// }
|
||||
if (ConnectManager.getInstance().isRebootFistConnect()) {
|
||||
start.onstar(ConnectManager.REBOOT_LAST_ONNECT_TIME);
|
||||
}
|
||||
}
|
||||
SPUtils.put(this, CommonConfig.SN_VERSIONCODE, BuildConfig.VERSION_CODE);
|
||||
registerReceivers();
|
||||
@@ -389,7 +389,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
JGYUtils.getInstance().wakeUpAppstore();
|
||||
if (!checkAoleyunApp()) {
|
||||
mPresenter.checkInfoUpdate();
|
||||
mPresenter.checkAoleyunUpdate();
|
||||
}
|
||||
return START_STICKY;
|
||||
}
|
||||
@@ -397,12 +397,13 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
lifecycleSubject.onNext(ActivityEvent.DESTROY);
|
||||
unRegisterReceivers();
|
||||
NetworkUtils.unregisterNetworkStatusChangedListener(this);
|
||||
lifecycleSubject.onNext(ActivityEvent.DESTROY);
|
||||
mPresenter.detachView();
|
||||
}
|
||||
|
||||
// TODO: 2022/3/31 暂时不检测版本
|
||||
private boolean checkAoleyunApp() {
|
||||
if (!ApkUtils.isAvailable(this, PackageNames.APPSTORE)) return false;
|
||||
if (!ApkUtils.isAvailable(this, PackageNames.DESKTOP)) return false;
|
||||
@@ -856,7 +857,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
} else {
|
||||
|
||||
}
|
||||
mPresenter.getStudesInfo();
|
||||
mPresenter.getStudesInfo(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -865,7 +866,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
mPresenter.sendMACAddress();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void sendMACFinish() {
|
||||
mPresenter.updateDeviceInfo();
|
||||
@@ -879,32 +879,11 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
@Override
|
||||
public void sendInstalledFinish() {
|
||||
Log.e(TAG, "sendInstalledFinish: ");
|
||||
mPresenter.checkInfoUpdate();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void checkInfoUpdateFinish() {
|
||||
mPresenter.checkStoreUpdate();
|
||||
mPresenter.checkAoleyunUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkStoreUpdateFinish() {
|
||||
mPresenter.checkDesktopUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkDesktopUpdateFinish() {
|
||||
mPresenter.checkNotifyUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkNotifyUpdateFinish() {
|
||||
mPresenter.checkBrowserUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkBrowserUpdateFinish() {
|
||||
public void checkAoleyunUpdateFinish() {
|
||||
mPresenter.checkTestUpdate();
|
||||
}
|
||||
|
||||
@@ -928,7 +907,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
Log.e(TAG, "setLogoImgFinish: ");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getDeveloperFinish() {
|
||||
mPresenter.getSystemSettingBegin();
|
||||
@@ -1011,7 +989,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
|
||||
@Override
|
||||
public void setWiFiPasswd() {
|
||||
mMMKV.encode(MainAPresenter.GET_SETTING_FINISH_TIME, System.currentTimeMillis());
|
||||
mPresenter.getScreenLockState();
|
||||
}
|
||||
|
||||
@@ -1033,6 +1010,4 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
SPUtils.put(this, "screen_tips", "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user