Does onPause
method get called during phone call?
I have a permission to READ_PHONE_STATE which I don't want. So, does the onPause method get called on a phone call, so that I can mute my apps audio there?
private PhoneStateListener phoneStateListener = new PhoneStateListener() {
@Override
public void onCallStateChanged(int state, String incomingNumber) {
if (doesUserHavePermission()) {
if (state == TelephonyManager.CALL_STATE_RINGING) {
onPhoneCallInterrupt(); //Method I made that mutes audio for phone call
} else if (state == TelephonyManager.CALL_STATE_IDLE) {
} else if (state == TelephonyManager.CALL_STATE_OFFHOOK) {
onPhoneCallInterrupt(); //Method I made that mutes audio for phone call
}
}
}
};
This requires this permission:
Which I want to get rid of. So do I have to explicitly listen for a call? Or can I just mute in the onPause() ?
Here is my app, you can see the permission requests on an attempt to download:
https://play.google.com/store/apps/details?id=com.culybrace.ruchir.buttonsmasher&hl=en
Questions can review, restate, emphasize, and/or summarize what is important. Questions stimulate discussion and creative and critical thinking, as well as determine how students are thinking. Questions help students retain material by putting into words otherwise unarticulated thoughts.
After you add a payment method, you may be asked to verify it. This step helps Google Wallet and your bank to protect your account. Based on your bank, you can choose from the following options. Your verification code comes from your bank, not Google Wallet.
In my experience, It depends on phones. there are 2 cases. 1. when ring comes -> new Call Activity starts. : In this case onPause is called because new Activity is over your app. 2. when ring comes -> ring window shows over the app.(not activity) : In this case no Activity call back is called. and user can use the app as before the ring called.
you may can use AudioManager without permission, check this out AUDIOFOCUS_LOSS called after a phone call in android
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With