Skip to content

Commit

Permalink
Merge pull request #314 from react-native-webrtc/fix_permission_version
Browse files Browse the repository at this point in the history
Fix android permissions depending on os version
  • Loading branch information
sboily authored Nov 11, 2020
2 parents 3a27fb1 + 413c6a0 commit 07d83e4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ public class RNCallKeepModule extends ReactContextBaseJavaModule {

private static final String E_ACTIVITY_DOES_NOT_EXIST = "E_ACTIVITY_DOES_NOT_EXIST";
private static final String REACT_NATIVE_MODULE_NAME = "RNCallKeep";
private static final String[] permissions = { Manifest.permission.READ_PHONE_STATE,
Manifest.permission.CALL_PHONE, Manifest.permission.RECORD_AUDIO, Manifest.permission.READ_PHONE_NUMBERS };
private static final String[] permissions = {
Build.VERSION.SDK_INT < 30 ? Manifest.permission.READ_PHONE_STATE : Manifest.permission.READ_PHONE_NUMBERS,
Manifest.permission.CALL_PHONE,
Manifest.permission.RECORD_AUDIO
};

private static final String TAG = "RNCK:RNCallKeepModule";
private static TelecomManager telecomManager;
Expand Down Expand Up @@ -521,7 +524,7 @@ private String getApplicationName(Context appContext) {

private Boolean hasPermissions() {
Activity currentActivity = this.getCurrentActivity();

if (currentActivity == null) {
return false;
}
Expand Down

0 comments on commit 07d83e4

Please sign in to comment.