How to show app UI to accept and reject video calls and prevent conflict with other on going apps?
up vote
1
down vote
favorite
I am working in an android app where user accept or reject video call which is working fine. but now i want to prevent app conflict with others if we have any other call like what's app or skype.
I have then read self managed connectionservice and try to implement it.
Here is complete doc
From Activity i first register
TelecomManager tm = (TelecomManager)
getSystemService(Context.TELECOM_SERVICE);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M)
{
PhoneAccountHandle phoneAccountHandle = new PhoneAccountHandle(
new ComponentName(this.getApplicationContext(), MyConService.class),
"example");
PhoneAccount phoneAccount = PhoneAccount.builder(phoneAccountHandle, "example")
.setCapabilities(PhoneAccount.CAPABILITY_SELF_MANAGED).build();
tm.registerPhoneAccount(phoneAccount);
}
Then try to add new call by doing something like below:
PhoneAccountHandle phoneAccountHandle = new PhoneAccountHandle(
new ComponentName(this.getApplicationContext(), MyConService.class),
"example");
Bundle extras = new Bundle();
Uri uri = Uri.fromParts(PhoneAccount.SCHEME_TEL, "11223344", null);
extras.putParcelable(TelecomManager.EXTRA_INCOMING_CALL_ADDRESS, uri);
tm.addNewIncomingCall(phoneAccountHandle, extras);
App is always crashed on tm.addNewIncomingCall(phoneAccountHandle, extras) with following log
/AndroidRuntime: FATAL EXCEPTION: main Process: com.liverep.videochat, PID: 27754
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.liverep.videochat/com.liverep.videochat.VideoChat}: java.lang.SecurityException: This PhoneAccountHandle is not enabled for this user!
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Caused by: java.lang.SecurityException: This PhoneAccountHandle is not enabled for this user!
at android.os.Parcel.readException(Parcel.java:1693)
at android.os.Parcel.readException(Parcel.java:1646)
at com.android.internal.telecom.ITelecomService$Stub$Proxy.addNewIncomingCall(ITelecomService.java:1450)
at android.telecom.TelecomManager.addNewIncomingCall(TelecomManager.java:1225)
at com.liverep.videochat.VideoChat.placeIncomingCall(VideoChat.java:792)
at com.liverep.videochat.VideoChat.call(VideoChat.java:730)
at com.liverep.videochat.VideoChat.registerForPhoneCall(VideoChat.java:716)
at com.liverep.videochat.VideoChat.onCreate(VideoChat.java:133)
at android.app.Activity.performCreate(Activity.java:6942)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2880)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
add a comment |
up vote
1
down vote
favorite
I am working in an android app where user accept or reject video call which is working fine. but now i want to prevent app conflict with others if we have any other call like what's app or skype.
I have then read self managed connectionservice and try to implement it.
Here is complete doc
From Activity i first register
TelecomManager tm = (TelecomManager)
getSystemService(Context.TELECOM_SERVICE);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M)
{
PhoneAccountHandle phoneAccountHandle = new PhoneAccountHandle(
new ComponentName(this.getApplicationContext(), MyConService.class),
"example");
PhoneAccount phoneAccount = PhoneAccount.builder(phoneAccountHandle, "example")
.setCapabilities(PhoneAccount.CAPABILITY_SELF_MANAGED).build();
tm.registerPhoneAccount(phoneAccount);
}
Then try to add new call by doing something like below:
PhoneAccountHandle phoneAccountHandle = new PhoneAccountHandle(
new ComponentName(this.getApplicationContext(), MyConService.class),
"example");
Bundle extras = new Bundle();
Uri uri = Uri.fromParts(PhoneAccount.SCHEME_TEL, "11223344", null);
extras.putParcelable(TelecomManager.EXTRA_INCOMING_CALL_ADDRESS, uri);
tm.addNewIncomingCall(phoneAccountHandle, extras);
App is always crashed on tm.addNewIncomingCall(phoneAccountHandle, extras) with following log
/AndroidRuntime: FATAL EXCEPTION: main Process: com.liverep.videochat, PID: 27754
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.liverep.videochat/com.liverep.videochat.VideoChat}: java.lang.SecurityException: This PhoneAccountHandle is not enabled for this user!
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Caused by: java.lang.SecurityException: This PhoneAccountHandle is not enabled for this user!
at android.os.Parcel.readException(Parcel.java:1693)
at android.os.Parcel.readException(Parcel.java:1646)
at com.android.internal.telecom.ITelecomService$Stub$Proxy.addNewIncomingCall(ITelecomService.java:1450)
at android.telecom.TelecomManager.addNewIncomingCall(TelecomManager.java:1225)
at com.liverep.videochat.VideoChat.placeIncomingCall(VideoChat.java:792)
at com.liverep.videochat.VideoChat.call(VideoChat.java:730)
at com.liverep.videochat.VideoChat.registerForPhoneCall(VideoChat.java:716)
at com.liverep.videochat.VideoChat.onCreate(VideoChat.java:133)
at android.app.Activity.performCreate(Activity.java:6942)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2880)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Hey, just a question; did you had to use SIP to make your video calls?
– Pablo
Dec 26 '17 at 10:24
Not compulsory to use SIP
– Najeeb Idrees
Jan 2 at 13:32
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am working in an android app where user accept or reject video call which is working fine. but now i want to prevent app conflict with others if we have any other call like what's app or skype.
I have then read self managed connectionservice and try to implement it.
Here is complete doc
From Activity i first register
TelecomManager tm = (TelecomManager)
getSystemService(Context.TELECOM_SERVICE);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M)
{
PhoneAccountHandle phoneAccountHandle = new PhoneAccountHandle(
new ComponentName(this.getApplicationContext(), MyConService.class),
"example");
PhoneAccount phoneAccount = PhoneAccount.builder(phoneAccountHandle, "example")
.setCapabilities(PhoneAccount.CAPABILITY_SELF_MANAGED).build();
tm.registerPhoneAccount(phoneAccount);
}
Then try to add new call by doing something like below:
PhoneAccountHandle phoneAccountHandle = new PhoneAccountHandle(
new ComponentName(this.getApplicationContext(), MyConService.class),
"example");
Bundle extras = new Bundle();
Uri uri = Uri.fromParts(PhoneAccount.SCHEME_TEL, "11223344", null);
extras.putParcelable(TelecomManager.EXTRA_INCOMING_CALL_ADDRESS, uri);
tm.addNewIncomingCall(phoneAccountHandle, extras);
App is always crashed on tm.addNewIncomingCall(phoneAccountHandle, extras) with following log
/AndroidRuntime: FATAL EXCEPTION: main Process: com.liverep.videochat, PID: 27754
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.liverep.videochat/com.liverep.videochat.VideoChat}: java.lang.SecurityException: This PhoneAccountHandle is not enabled for this user!
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Caused by: java.lang.SecurityException: This PhoneAccountHandle is not enabled for this user!
at android.os.Parcel.readException(Parcel.java:1693)
at android.os.Parcel.readException(Parcel.java:1646)
at com.android.internal.telecom.ITelecomService$Stub$Proxy.addNewIncomingCall(ITelecomService.java:1450)
at android.telecom.TelecomManager.addNewIncomingCall(TelecomManager.java:1225)
at com.liverep.videochat.VideoChat.placeIncomingCall(VideoChat.java:792)
at com.liverep.videochat.VideoChat.call(VideoChat.java:730)
at com.liverep.videochat.VideoChat.registerForPhoneCall(VideoChat.java:716)
at com.liverep.videochat.VideoChat.onCreate(VideoChat.java:133)
at android.app.Activity.performCreate(Activity.java:6942)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2880)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
I am working in an android app where user accept or reject video call which is working fine. but now i want to prevent app conflict with others if we have any other call like what's app or skype.
I have then read self managed connectionservice and try to implement it.
Here is complete doc
From Activity i first register
TelecomManager tm = (TelecomManager)
getSystemService(Context.TELECOM_SERVICE);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M)
{
PhoneAccountHandle phoneAccountHandle = new PhoneAccountHandle(
new ComponentName(this.getApplicationContext(), MyConService.class),
"example");
PhoneAccount phoneAccount = PhoneAccount.builder(phoneAccountHandle, "example")
.setCapabilities(PhoneAccount.CAPABILITY_SELF_MANAGED).build();
tm.registerPhoneAccount(phoneAccount);
}
Then try to add new call by doing something like below:
PhoneAccountHandle phoneAccountHandle = new PhoneAccountHandle(
new ComponentName(this.getApplicationContext(), MyConService.class),
"example");
Bundle extras = new Bundle();
Uri uri = Uri.fromParts(PhoneAccount.SCHEME_TEL, "11223344", null);
extras.putParcelable(TelecomManager.EXTRA_INCOMING_CALL_ADDRESS, uri);
tm.addNewIncomingCall(phoneAccountHandle, extras);
App is always crashed on tm.addNewIncomingCall(phoneAccountHandle, extras) with following log
/AndroidRuntime: FATAL EXCEPTION: main Process: com.liverep.videochat, PID: 27754
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.liverep.videochat/com.liverep.videochat.VideoChat}: java.lang.SecurityException: This PhoneAccountHandle is not enabled for this user!
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Caused by: java.lang.SecurityException: This PhoneAccountHandle is not enabled for this user!
at android.os.Parcel.readException(Parcel.java:1693)
at android.os.Parcel.readException(Parcel.java:1646)
at com.android.internal.telecom.ITelecomService$Stub$Proxy.addNewIncomingCall(ITelecomService.java:1450)
at android.telecom.TelecomManager.addNewIncomingCall(TelecomManager.java:1225)
at com.liverep.videochat.VideoChat.placeIncomingCall(VideoChat.java:792)
at com.liverep.videochat.VideoChat.call(VideoChat.java:730)
at com.liverep.videochat.VideoChat.registerForPhoneCall(VideoChat.java:716)
at com.liverep.videochat.VideoChat.onCreate(VideoChat.java:133)
at android.app.Activity.performCreate(Activity.java:6942)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2880)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
edited Nov 9 at 8:11
Suraj Rao
22.4k75469
22.4k75469
asked Dec 21 '17 at 1:22
Najeeb Idrees
140212
140212
Hey, just a question; did you had to use SIP to make your video calls?
– Pablo
Dec 26 '17 at 10:24
Not compulsory to use SIP
– Najeeb Idrees
Jan 2 at 13:32
add a comment |
Hey, just a question; did you had to use SIP to make your video calls?
– Pablo
Dec 26 '17 at 10:24
Not compulsory to use SIP
– Najeeb Idrees
Jan 2 at 13:32
Hey, just a question; did you had to use SIP to make your video calls?
– Pablo
Dec 26 '17 at 10:24
Hey, just a question; did you had to use SIP to make your video calls?
– Pablo
Dec 26 '17 at 10:24
Not compulsory to use SIP
– Najeeb Idrees
Jan 2 at 13:32
Not compulsory to use SIP
– Najeeb Idrees
Jan 2 at 13:32
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
It looks like you don't have MANAGE_OWN_CALLS permission in your AndroidManifest.xml
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
It looks like you don't have MANAGE_OWN_CALLS permission in your AndroidManifest.xml
add a comment |
up vote
0
down vote
It looks like you don't have MANAGE_OWN_CALLS permission in your AndroidManifest.xml
add a comment |
up vote
0
down vote
up vote
0
down vote
It looks like you don't have MANAGE_OWN_CALLS permission in your AndroidManifest.xml
It looks like you don't have MANAGE_OWN_CALLS permission in your AndroidManifest.xml
answered Jun 18 at 8:28
pranksterN1
12
12
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47916611%2fhow-to-show-app-ui-to-accept-and-reject-video-calls-and-prevent-conflict-with-ot%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Hey, just a question; did you had to use SIP to make your video calls?
– Pablo
Dec 26 '17 at 10:24
Not compulsory to use SIP
– Najeeb Idrees
Jan 2 at 13:32