diff --git a/src/android/CordovaCall.java b/src/android/CordovaCall.java index 4c23e50..2c52766 100644 --- a/src/android/CordovaCall.java +++ b/src/android/CordovaCall.java @@ -61,21 +61,24 @@ public static Icon getIcon() { public void initialize(CordovaInterface cordova, CordovaWebView webView) { cordovaInterface = cordova; super.initialize(cordova, webView); - appName = getApplicationName(this.cordova.getActivity().getApplicationContext()); + /*appName = getApplicationName(this.cordova.getActivity().getApplicationContext()); handle = new PhoneAccountHandle(new ComponentName(this.cordova.getActivity().getApplicationContext(),MyConnectionService.class),appName); tm = (TelecomManager)this.cordova.getActivity().getApplicationContext().getSystemService(this.cordova.getActivity().getApplicationContext().TELECOM_SERVICE); + if(android.os.Build.VERSION.SDK_INT >= 26) { phoneAccount = new PhoneAccount.Builder(handle, appName) .setCapabilities(PhoneAccount.CAPABILITY_SELF_MANAGED) .build(); + + Log.i("Test-1","Test -1"); tm.registerPhoneAccount(phoneAccount); } if(android.os.Build.VERSION.SDK_INT >= 23) { phoneAccount = new PhoneAccount.Builder(handle, appName) - .setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER) + .setCapabilities(PhoneAccount.CAPABILITY_SELF_MANAGED) .build(); tm.registerPhoneAccount(phoneAccount); - } + }*/ callbackContextMap.put("answer",new ArrayList()); callbackContextMap.put("reject",new ArrayList()); callbackContextMap.put("hangup",new ArrayList());