Block calls without ringing

I’ve a rooted phone (Samsung Grand Prime, without CM, just the STOCK Rom), and what I want to know if it’s possible with Android 5.0 phone or newer to block calls without ringing. By default, the Call Rejection List just wait 1 ring before reject the call… All blocking applications has to wait 1 ring too before blocking the call, which is logical. But the main drawback of this is that people could suppose if they’re blocked.

I’ve tried two applications : RBC & Call Master that do this stuff (they need root permissions) but each shutdown the mobile network and don’t seem to work well witht Lolipop or newer.

I’ve read somewhere that since Gingerbread, Google don’t allow applications to get the MODIFY_PHONE_STATE, so just only apps that need root could do it.

How can I disable ability to make outgoing call, messages but keep incoming calls?

Is there some Android app, which could be installed while enabling a password – that blocks ability to bring up Dialler, Addressbook/Contacts, Messaging application screen, but still allows incoming calls to be answered ?

The idea is to provide the phone to someone who is not authorized to make outgoing calls using this phone, but should be able to answer calls made to this phone.

If similar restrictions can be put on messaging, that’d be great, but if not — it is something that I could live with.

The password is to something that’d be known by me, but not by the person who will usually be using the phone.

Would be best if this doesn’t require rooting the phone, but in worst-case, I’m willing to root the phone.

nsilo and spam calls

I bought a domain from nsilo last week and have already received about 15 calls from people selling web design services. I’ve never had this… | Read the rest of

View for logging telephone calls

As part of a web-based claims system I have created, there is a view for logging telephone calls. If a call is incoming, the claims handler asks the caller a series of data protection questions to validate who they are. The questions are generated from a database and each question has one or more valid answers. The valid answers are also generated from the database.

Example view:

enter image description here

Things of note for my question:

  • In addition to the valid answers, there are also ‘Unanswered’ and ‘Incorrect Response’ answers. These are added via client code and are not part of the original valid answers generated by the database.
  • Each valid answer has a ‘check’ icon
  • The invalid answer has a ‘cross’ icon
  • The unanswered answer has no icon

Here’s my client code for each type of answer:

class Answer {     constructor(answer, state) {         this.el = document.createElement('option');         this.el.value = answer;         this.el.textContent = answer;          state.apply(this);     } }  class AnswerState {     constructor(validationIcon, validationColor) {         this.validationIcon = validationIcon;         this.validationColor = validationColor;     }      apply(answer) {         answer.el.setAttribute('data-validation-icon', this.validationIcon);         answer.el.setAttribute('data-validation-color', this.validationColor);     } }  class UnansweredState extends AnswerState {     apply(answer) {         super.apply(answer);         answer.el.setAttribute('data-unanswered', '');     } }  class ValidAnswerState extends AnswerState {     apply(answer) {         super.apply(answer);         answer.el.setAttribute('data-valid', '');         answer.el.setAttribute('data-icon', 'icons/round-done-24px.svg');     } }  class InvalidAnswerState extends AnswerState {     apply(answer) {         super.apply(answer);         answer.el.setAttribute('data-invalid', '');         answer.el.setAttribute('data-icon', 'icons/round-clear-24px.svg');     } }  export { Answer, UnansweredState, ValidAnswerState, InvalidAnswerState }; 

And this is how I create the answer select element for each question:

function createAnswerSelect(validAnswers) {     const select = document.createElement('select');     const unansweredState = new UnansweredState('remove', 'grey');     const invalidAnswerState = new InvalidAnswerState('clear', 'red');     const validAnswerState = new ValidAnswerState('done', 'green');      select.add(new Answer('Unanswered', unansweredState).el);      validAnswers.forEach(answer => {         select.add(new Answer(answer.answer, validAnswerState).el);     });      select.add(new Answer('Incorrect response', invalidAnswerState).el);      return select; } 

Is this a reasonable way to encapsulate the variability of the different type of answers (unanswered, valid, invalid)? It feels like ‘unanswered’ should be the state of a question, not an answer.

As per usual, I am questioning myself. The code works, but I have a nagging feeling it is a ‘bad’ design somehow.

Working through the single responsibility principle (SRP) in Python when calls are expensive

Some base points:

  • Python method calls are “expensive” due to its interpreted nature. In theory, if your code is simple enough, breaking down Python code has negative impact besides readability and reuse (which is a big gain for developers, not so much for users).
  • The single responsibility principle (SRP) keeps code readable, is easier to test and maintain.
  • The project has a special kind of background where we want readable code, tests, and time performance.

For instance, code like this which invokes several methods (x4) is slower than the following one which is just one.

from operator import add  class Vector:     def __init__(self,list_of_3):         self.coordinates = list_of_3      def move(self,movement):         self.coordinates = list( map(add, self.coordinates, movement))         return self.coordinates      def revert(self):         self.coordinates = self.coordinates[::-1]         return self.coordinates      def get_coordinates(self):         return self.coordinates  ## Operation with one vector vec3 = Vector([1,2,3]) vec3.move([1,1,1]) vec3.revert() vec3.get_coordinates() 

In comparison to this:

from operator import add  def move_and_revert_and_return(vector,movement):     return list( map(add, vector, movement) )[::-1]  move_and_revert_and_return([1,2,3],[1,1,1]) 

If I am to parallelize something such as that, it is pretty objective I lose performance. Mind that is just an example; my project has several mini routines with math such as that – While it is much easier to work with, our profilers are disliking it.

How and where do we embrace the SRP without compromising performance in Python, as its inherent implementation directly impacts it?

Are there workarounds, like some sort of pre-processor that puts things in-line for release?

Or is Python simply poor at handling code breakdown altogether?

How to handle database calls from all over the application

I’m building a data manager for my app and I’m wondering what’s the best way to handle database calls inside my app. This app uses the database extensively in practically all screens.

I thought about using a singleton that I can access easily everywhere, but that will make it harder to test the classes that use it.

Then I decided to inject my data manager whenever I need it, but it becomes cumbersome and looks like an overkill.

Is there any other option I can try or a better solution for this situation?

Design choices for scaling an app that needs to make scheduled API calls and hit deadlines

I have a Flask-based app in Python that users can use to schedule particular tasks which are in effect API calls to other REST services. I need those tasks to execute exactly at the scheduled time, and retry shortly after if they fail.

Ordinarily I could have a cron job, or similar, just kick off all the tasks which would complete in their own time. In this case it’s really important that all 11am jobs run within a minute of that time and they are often scheduled around similar times. For example, 10am has a lot of tasks, but there are none at 10pm. That might change with global users starting to use the app, but we aren’t there yet.

I could build my own homegrown script to spin up threads, or use async in Python. I was hoping there would be something pre-made that could do this with some level of operational readiness, but ideally the solution would be relatively simple to integrate and support.


I am working on RN52 bluetooth module, for normal audio streaming(song/A2DP), i am getting analog values at speaker output( SPK L and SPK R both), When i am pausing the song, analog values getting changed on SPK L side.which is distinguishable that song is playing or not. But for call (HSP) the output is very much confusing, as When i am calling a number, i am getting analog values(XYZ) from SPK L side while talking, if he mutes the call, still i am getting the same analog output(XYZ) from (SPK L), my purpose is that, i want to know when the call is getting muted, the analog value should change my side when someone mutes the call as there should be nothing on my speaker when the person i dialed mutes the call , may be from some other pins or by using some other protocol, i can get my desired output. PLEASE HELP

Applewatch: can it be configured to send calls only?

I would like to configure an Applewatch so that it can send phone calls only. The watch would be for my elderly mother, so the ability to call for help (especially if the watch detects a fall) is invaluable. Naturally, I do not want my inbound calls to go to the Applewatch and bother the wearer, as it would be tied to my TMO cellular service.

Can the cellular Applewatch be configured to send calls only?