perm.modeFlags |= modeFlags;
if (owner == null) {
perm.globalModeFlags |= modeFlags;
- } else if ((modeFlags&Intent.FLAG_GRANT_READ_URI_PERMISSION) != 0) {
- perm.readOwners.add(owner);
- owner.addReadPermission(perm);
- } else if ((modeFlags&Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0) {
- perm.writeOwners.add(owner);
- owner.addWritePermission(perm);
+ } else {
+ if ((modeFlags&Intent.FLAG_GRANT_READ_URI_PERMISSION) != 0) {
+ perm.readOwners.add(owner);
+ owner.addReadPermission(perm);
+ }
+ if ((modeFlags&Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0) {
+ perm.writeOwners.add(owner);
+ owner.addWritePermission(perm);
+ }
}
}