Open lvyandev opened 5 years ago
my code
Observable .just(1) .delay(1, TimeUnit.SECONDS) .compose( RxPermissions(this) .ensureEachCombined( *PermissionConstants.getPermissions(PermissionConstants.STORAGE), *PermissionConstants.getPermissions(PermissionConstants.CAMERA), *PermissionConstants.getPermissions(PermissionConstants.LOCATION), // when I delete this request,it's fine *PermissionConstants.getPermissions(PermissionConstants.PHONE) ) ) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe { LogUtils.d(it) @SuppressLint("MissingPermission") if (it.granted) { FileUtils.createOrExistsDir(AppConstants.APP_FILE_DIR) CrashUtils.init(AppConstants.APP_CRASH_LOG_DIR) { _, _ -> AppUtils.relaunchApp() } doLaunch() } else { DialogHelper.showOpenAppSettingDialog( View.OnClickListener { PermissionUtils.launchAppDetailsSettings() AppUtils.exitApp() }, View.OnClickListener { AppUtils.exitApp() } ) } } //----------------------------------------------------------------------- // PermissionConstants.PHONE private static final String[] GROUP_PHONE = { permission.READ_PHONE_STATE, permission.READ_PHONE_NUMBERS, permission.CALL_PHONE, permission.ANSWER_PHONE_CALLS, permission.READ_CALL_LOG, permission.WRITE_CALL_LOG, permission.ADD_VOICEMAIL, permission.USE_SIP, permission.PROCESS_OUTGOING_CALLS };
logcat
Permission{name='android.permission.READ_EXTERNAL_STORAGE, android.permission.WRITE_EXTERNAL_STORAGE, android.permission.CAMERA, android.permission.ACCESS_FINE_LOCATION, android.permission.ACCESS_COARSE_LOCATION, android.permission.READ_PHONE_STATE, android.permission.READ_PHONE_NUMBERS, android.permission.CALL_PHONE, android.permission.ANSWER_PHONE_CALLS, android.permission.READ_CALL_LOG, android.permission.WRITE_CALL_LOG, com.android.voicemail.permission.ADD_VOICEMAIL, android.permission.USE_SIP, android.permission.PROCESS_OUTGOING_CALLS', granted=false, shouldShowRequestPermissionRationale=false}
with GIF below
my code
logcat
with GIF below