【光环助手V5.4.0】儿童/青少年模式(对接设置页面)https://git.ghzs.com/pm/halo-app-issues/-/issues/1571
This commit is contained in:
@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user