This commit is contained in:
zhongchao
2021-04-12 15:53:18 +08:00
parent dfbf3e547d
commit 6cc1a9fe2b
2 changed files with 10 additions and 12 deletions

1
.idea/gradle.xml generated
View File

@@ -91,6 +91,7 @@
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
</component>

View File

@@ -183,20 +183,16 @@ public class MogoApplication extends AbsMogoApplication {
*/
private void prepareBaseService(IMogoServiceApis apis, long delay) {
UiThreadHandler.postDelayed(() -> {
// 第三方平台的sn是服务端生成的所以必须在返回后才能开启
if (TextUtils.isEmpty(Utils.getSn())) {
preparePassportEnvironment(apis, () -> {
prepareSocketAndLocationServices(apis);
});
} else {
preparePassportEnvironment(apis, null);
prepareSocketAndLocationServices(apis);
}
}, delay);
// 第三方平台的sn是由AI云SDK中服务调用通过服务端生成的
preparePassportEnvironment();
prepareSocketAndLocationServices(apis);
//无延迟
// UiThreadHandler.postDelayed(() -> {
//
// }, delay);
}
private void preparePassportEnvironment(IMogoServiceApis apis, Runnable after) {
private void preparePassportEnvironment() {
// 配置云服务API
MoGoAiCloudClientConfig clientConfig = MoGoAiCloudClientConfig.getInstance();
// 设置网络环境HTTP_DNS_ENV_QA、HTTP_DNS_ENV_RELEASE、HTTP_DNS_ENV_DEV
@@ -257,6 +253,7 @@ public class MogoApplication extends AbsMogoApplication {
}
private void prepareSocketAndLocationServices(IMogoServiceApis apis) {
//开启Socket长链服务
apis.getSocketManagerApi(getApplicationContext()).init(getApplicationContext(), DebugConfig.getSocketAppId());
if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
apis.getLocationInfoApi().start();