【光环助手V5.4.0】儿童/青少年模式(对接设置页面)https://git.ghzs.com/pm/halo-app-issues/-/issues/1571

This commit is contained in:
lyr
2021-10-22 12:28:46 +08:00
parent 3818e17976
commit 2eb5fb7526
4 changed files with 31 additions and 35 deletions

View File

@ -44,7 +44,6 @@ import com.gh.download.DownloadManager;
import com.gh.gamecenter.entity.AuthDialogEntity;
import com.gh.gamecenter.entity.DeviceDialogEntity;
import com.gh.gamecenter.entity.PrivacyPolicyEntity;
import com.gh.gamecenter.eventbus.EBTeenagerModelStatus;
import com.gh.gamecenter.manager.FilterManager;
import com.gh.gamecenter.retrofit.BiResponse;
import com.gh.gamecenter.retrofit.Response;
@ -378,7 +377,6 @@ public class SplashScreenActivity extends BaseActivity {
private void prefetchData() {
AppExecutor.getIoExecutor().execute(() -> {
if (HaloApp.getInstance().isBrandNewInstall) getTeenagerMode();
Config.getGhzsSettings();
deviceDialogSetting();
getFilterDetailTags();
@ -411,30 +409,6 @@ public class SplashScreenActivity extends BaseActivity {
});
}
@SuppressLint("CheckResult")
private void getTeenagerMode() {
RetrofitManager.getInstance(HaloApp.getInstance().getApplication())
.getApi().getTeenagerMode(HaloApp.getInstance().getGid())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new BiResponse<ResponseBody>() {
@Override
public void onSuccess(ResponseBody data) {
try {
boolean preStatus = SPUtils.getBoolean(Constants.SP_TEENAGER_MODE);
JSONObject object = new JSONObject(data.string());
boolean curStatus = "open".equals(object.getString("status"));
SPUtils.setBoolean(Constants.SP_TEENAGER_MODE, curStatus);
if (preStatus != curStatus) {
EventBus.getDefault().post(new EBTeenagerModelStatus());
}
} catch (Throwable e) {
e.printStackTrace();
}
}
});
}
@AfterPermissionGranted(REQUEST_PERMISSION_TAG)
private void checkAndRequestPermission() {
if (EasyPermissions.hasPermissions(this, mPermissions)) {