Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9248363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:55:46+00:00 2026-06-18T09:55:46+00:00

I am working on an android that will allow the user to add numbers

  • 0

I am working on an android that will allow the user to add numbers to a blacklist. When an incoming number matches a number in the blacklist then the call should be rejected, even if the phone does ring briefly and then disconnects the call.

Everything I’ve found including on SO, says it can’t be done without creating AIDL in com.android.internal.telephony which I’ve created but I can’t add the modify phone state permission as it says it needs to be a system app.

I am targetting ICS upwards and I have seen other apps block calls in ICS and up so how is this done. I’ve also tried adding the modify phone state permission to the manifest file and it displays an error saying that it is only available for system apps so how do I get around this issue. I don’t want the app to have to be rooted.

Thanks for any help you can provide

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:55:47+00:00Added an answer on June 18, 2026 at 9:55 am

    I’ve found the answer by a bit of luck.

    Instead of adding permission MODIFY_PHONE_STATE add permission CALL_PHONE

    Create a new package called com.android.internal.telephony

    Inside this package create a file called ITelephony.aidl and add the following content

    package com.android.internal.telephony;

    interface ITelephony {      
    
        boolean endCall();     
    
        void answerRingingCall();      
    
        void silenceRinger(); 
    
    }
    

    Use the below code in order to block the call

    try
            {
                TelephonyManager tm = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
                Class c = Class.forName(tm.getClass().getName());
                Method m = c.getDeclaredMethod("getITelephony");
                m.setAccessible(true);
    
                com.android.internal.telephony.ITelephony  telephonyService = (ITelephony)m.invoke(tm);
                //telephonyService.silenceRinger();
                telephonyService.endCall();
            }
            catch (Exception e)
            {
                Log.d("BLOCK CALL", e.toString());
                Toast.makeText(context, e.toString(), Toast.LENGTH_LONG).show();
            }
    

    Hope this helps others, its not too easy to find. I don’t understand why Google removed the ability to do this without mucking about like this though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on Android App that will user's input data (from text box) store
i'm working on a android app that will display Strings to the user, and
Hey guys i am currently working on an android app that will allow me
I am working on an Android application that shows a map with the user's
I'm working on an Android widget that will show the current network state (i.e
Hello, Im working on a solution for Android that will record calls (both out
I'm working on an application that will be available for Android and iPhone. The
I am working on an Android mapping app that allows a user to type
I'm working on an Android app that will look like this (Photoshop mockup): (source:
So I'm working on a chunk of code that will allow me to run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.