Skip to content

Commit 09b533a

Browse files
authored
Merge pull request #556 from grit96/patch-2
Check permissions in hasPhoneAccount
2 parents 3bff250 + 35d6e7f commit 09b533a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -982,9 +982,10 @@ private Boolean hasPermissions() {
982982
return hasPermissions;
983983
}
984984

985-
private static boolean hasPhoneAccount() {
986-
return isConnectionServiceAvailable() && telecomManager != null
987-
&& telecomManager.getPhoneAccount(handle) != null && telecomManager.getPhoneAccount(handle).isEnabled();
985+
private boolean hasPhoneAccount() {
986+
return isConnectionServiceAvailable() && telecomManager != null &&
987+
hasPermissions() && telecomManager.getPhoneAccount(handle) != null &&
988+
telecomManager.getPhoneAccount(handle).isEnabled();
988989
}
989990

990991
private void registerReceiver() {

0 commit comments

Comments
 (0)