Skip to content

Commit 8fef467

Browse files
authored
Merge pull request #576 from mluksha/master
[Android] Fix permission checking in the Quit state
2 parents e96cecb + 5e465fa commit 8fef467

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -965,15 +965,11 @@ private String getApplicationName(Context appContext) {
965965
}
966966

967967
private Boolean hasPermissions() {
968-
Activity currentActivity = this.getCurrentReactActivity();
969-
970-
if (currentActivity == null) {
971-
return false;
972-
}
968+
ReactApplicationContext context = getContext();
973969

974970
boolean hasPermissions = true;
975971
for (String permission : permissions) {
976-
int permissionCheck = ContextCompat.checkSelfPermission(currentActivity, permission);
972+
int permissionCheck = ContextCompat.checkSelfPermission(context, permission);
977973
if (permissionCheck != PackageManager.PERMISSION_GRANTED) {
978974
hasPermissions = false;
979975
}

0 commit comments

Comments
 (0)