Use application activities to judge a call
Closed this issue · 27 comments
The feature
Whether it is possible to support the use of specific application activity on foreground to judge whether a call is being rejected or received, because an app is usually not only used for making or receiving calls.
I don't understand, especially for this:
because an app is usually not only used for making or receiving calls.
Can you show me a use case?
A lot of social apps not only has the call function, but also has the functions of receiving and sending text messages. When sending and receiving text messages, incoming calls can also be answered.
So using a specified activity to determine whether a phone call can be answered currently appears to be useful.
Or this func are not use for this use case?
I still don't understand. Let's say you are using WhatsApp, when it's in the foreground, you want all calls to be allowed? Why is that?
Maybe I didn't make myself clear, I'm talking about an app that's not just for phone calls, like whatsapp, telegram, even tiktok, which is used by our company for (short) meetings, we have a dedicated corporate account.
These apps can send and receive text messages, they can send and receive videos, There is also the ability to make and receive voice or video calls. So an app have a lot of activites.
Only when we open a specific activity (such as video calls, group calls, etc.) we need to disable all external calls, but when we are not in a meeting, the activities of these apps for meetings will not be opened in foreground.
So this function is required. To support not allowing calls to dial in only when a specific activity in specific app is open.
The "acitivity" in this comment refers to the activity in Android programming.
The current version of meeting mode supports rejecting calls when an app is in the foreground, but it does not specify an activity, so for me personally, many calls will be rejected by mistake. So I came up with this suggestion, to support the foreground detect to a specific activity in a specific app.
I'm sorry I didn't specify that this is an improvement to the meeting mode, not an entirely new feature.
I guess you're not using the latest version, now there is the Meeting Mode, which does exactly what you need, calls will be rejected during online video conferences.
For example, when an application package name is com.meeting.app opens an application named ".MeetVideoAcitivity" proves that I am currently using the app to make a meeting, so the call should be rejected at this time, but when the activity is not opened, it proves that I am not using the app to make a call, and the call should not be rejected by the "meeting mode" function.
This function has a great impact on me, but I don't know how many people need this function, so I just make suggestions, because we often use these apps to answer text messages, but to answer text messages is not to use this app for meetings, at this time we can answer the phone, but at this time the phone will be rejected by the "meeting mode" of the software.
Ah, I now use the version compiled a few hours ago, this feature has been available for a long time, but it can only be accurate to app, not accurate to acitivity
Maybe I didn't make myself clear, I'm talking about an app that's not just for phone calls, like whatsapp, telegram, even tiktok, which is used by our company for (short) meetings, we have a dedicated corporate account.
These apps can send and receive text messages, they can send and receive videos, There is also the ability to make and receive voice or video calls. So an app have a lot of activites.
Only when we open a specific activity (such as video calls, group calls, etc.) we need to disable all external calls, but when we are not in a meeting, the activities of these apps for meetings will not be opened in foreground.
So this function is required. To support not allowing calls to dial in only when a specific activity in specific app is open.The "acitivity" in this comment refers to the activity in Android programming.
I'm talk about accurate to a specific activity not only an app ^.^
It's checking if the app is running a foreground service, which it's more accurate than checking activity, this approach should work for any apps.
Just like
reject incoming call: When the com.meeting.app/.MeetVideoAcitvity opened in foreground.
not to reject any calls: When the com.meeting.app/.MeetVideoAcitvity activity are not in foreground.
It's checking if the app is running a foreground service, which it's more accurate than checking activity, this approach should work for any apps.
Yes, but an app is not only used for making and receiving calls, it has more than one function. If you open a specific app, you will get rejected calls, so there will be many phone calls that will be rejected. But at this time, I opened this app, but I did not use this app for meetings
Just like
reject incoming call: When the com.meeting.app/.MeetVideoAcitvity opened in foreground.not to reject any calls: When the com.meeting.app/.MeetVideoAcitvity activity are not in foreground.
So what I really want is for an app to reject calls when it opens a specific acitivity in a specific app, rather than rejecting all calls when it opens the app.
No , it won't reject calls just because the app is opened. It won't regret calls even when you are typing messages. It will only reject calls during a video meeting.
I guess you don't really understand what a foreground service is, please try this feature, It should work as expected.
I guess you don't really understand what a foreground service is, please try this feature, It should work as expected.
I have been using this app for many days, and he will refuse all the calls when I open this app.
Is it because our app will always run a front service?
Because our app usually runs a service to keep it active in order not to get killed
Let me explain a bit, the "foreground service" is not just "the app is running in the foreground".
It's an Android service, when an app starts a video meeting, It will start a service to keep the app alive, usually there will be a notification that can't be deleted, if you delete it, It will appear again later. This service is what I meant by the foreground service.
When you just opened the app, or typing messages, It won't start such service, because it's unnecessary and such service would consume more battery. However, when the video meeting is started, it's will appear in the notification, which means the foreground service is started.
Which app will reject all calls where it's just started?
I've noticed that most compliant apps do turn on a foreground service to make sure it doesn't kill when, for example, meeting or make a video call, but if the app isn't written in rules and runs an empty foreground service in order to keep it alive in any situation? this dirty method of keeping it alive, and is very common on our side.
Our internal meeting app is just like that :(
Because it monitors workers' cell phone use
As for the case of our company app running the foreground service to ensure that it does not get killed under any situation it is just a guess, because this particular app does reject all calls when opened, but I have just tested other apps, and there are other apps that can work properly in conference mode according to this logic.
But based on the internal app, I can't send this app here.
I remember that checking foreground activity is restricted by Android, not very sure. I'll find a way to solve this.
I remember that checking foreground activity is restricted by Android, not very sure. I'll find a way to solve this.
Thank you very much. According to the android system regulations, there are restrictions on the foreground service, but not all apps comply it, especially when the app is forced to use, people have no choice. Personally, I think the least time-consuming method is to specify the activity manually, which may take the least time for you.
Activity is the last option, it's unreliable, it can be overlapped or minimized, and it's more difficult to implement. FG service on the other hand, is better in all aspects.
FG services also have names, the app now allows you to enter some service names to exclude.
Done in the action build: https://github.com/aj3423/SpamBlocker/actions/runs/12233459161
Edited:
Due to the config change, you might need to reconfigure the RecentApps and MeetingMode.
Activity is the last option, it's unreliable, it can be overlapped or minimized, and it's more difficult to implement. FG service on the other hand, is better in all aspects.
FG services also have names, the app now allows you to enter some service names to exclude.
Done in the action build: https://github.com/aj3423/SpamBlocker/actions/runs/12233459161
Edited:
Due to the config change, you might need to reconfigure the RecentApps and MeetingMode.
Thank you very much, it's working, it's perfect, but there's also a small suggestion, is to add a direct click to add exceptions, manual input is a bit cumbersome, especially if the name is very long.
However, it meets my needs now, so I don't want to take up any more of your time. If you want to include this feature, it can be released as part of the next formal version, without needing a github Action release for me.
I'll add the "click to add the name" in the next release.
I'll add the "click to add the name" in the next release.
Thank you very much!!!
Have a nice day!