optimize permission requester

androidx
Zhanty 5 years ago
parent a9dbb35534
commit 8b2184e882
  1. 4
      lib_base/src/main/java/com/android/base/permission/PermissionCallerImpl.java

@ -71,8 +71,12 @@ class PermissionCallerImpl implements EasyPermissions.PermissionCaller {
getPermissionUIProvider() getPermissionUIProvider()
.showAskAgainDialog(mContextWrapper.getContext(), perms.toArray(new String[0]), .showAskAgainDialog(mContextWrapper.getContext(), perms.toArray(new String[0]),
(dialog, which) -> { (dialog, which) -> {
try {
Intent intentForPermission = EasyPermissions.getIntentForPermission(mContextWrapper.getContext()); Intent intentForPermission = EasyPermissions.getIntentForPermission(mContextWrapper.getContext());
mContextWrapper.startActivityForResult(intentForPermission, REQUEST_PERMISSION_FOR_SETTING, null); mContextWrapper.startActivityForResult(intentForPermission, REQUEST_PERMISSION_FOR_SETTING, null);
} catch (Exception e) {
notifyPermissionDenied(perms);
}
}, },
(dialog, which) -> notifyPermissionDenied(perms)); (dialog, which) -> notifyPermissionDenied(perms));
} else { } else {

Loading…
Cancel
Save