Skip to content

Commit

Permalink
[expo-permissions][android] Fix brightness permission (#7276)
Browse files Browse the repository at this point in the history
* [expo-permissions][android] Fix brightness permission

* [expo-permissions] Update changelog.md
  • Loading branch information
lukmccall authored Mar 9, 2020
1 parent 0303461 commit ab17510
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ This is the log of notable changes to the Expo client that are developer-facing.

### 🐛 Bug fixes

- Fixed `Brightness.requestPermissionsAsync` throwing `permission cannot be null or empty` error on Android. ([#7276](https://github.com/expo/expo/pull/7276) by [@lukmccall](https://github.com/lukmccall))

## 37.0.0

### 📚 3rd party library updates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,13 @@ open class PermissionsService(val context: Context) : InternalModule, Permission
mAskAsyncListener = null
mAskAsyncRequestedPermissions = null

// invoke actual asking for permissions
askForManifestPermissions(askAsyncRequestedPermissions, askAsyncListener)
if (askAsyncRequestedPermissions.isNotEmpty()) {
// invoke actual asking for permissions
askForManifestPermissions(askAsyncRequestedPermissions, askAsyncListener)
} else {
// user asked only for Manifest.permission.WRITE_SETTINGS
askAsyncListener.onResult(mutableMapOf())
}
}

override fun onHostPause() = Unit
Expand Down

0 comments on commit ab17510

Please sign in to comment.