1

I'm working on an Android app that is supposed to block incoming calls and (eventually) messages. So far I've read that you can use the internal ITelephony interface to intercept and eventually block calls.

One step of that process involves creating a package called "com.android.internal.telephony" containing a "ITelephony.aidl" file. I've got the following path right now:

\MyApp\app\src\main\java\company\MyApp\com\android\internal\telephony\ITelephony.aidl (this is what Android Studio creates with the "Create Package" command.

The issue is that, for some reason, I get the following error:

error: package com.android.internal.telephony does not exist. I've tried placing the aidl file in different locations but with the same result. Am I doing something wrong and, if so, how do I solve this?

Thanks.

Puscasu Emanuel
  • 145
  • 2
  • 7

2 Answers2

0

This might be a solution to your problem:

you have added ITelephony.AIDL file in your project? and if you have added then your package name must be com/android/internal/telephony/ITelephony.AIDL: for more information Blocking Incoming call. download AIDL file from here

From: how to resolve this error "com.android.internal.telephony cannot be resolved to a type" in android

Shortly: make com/android/internal/telephony folder structure inside src folder and put aidl file in telephony folder.

So you telephony package may has wrong directory structure.

Please check and try to follow steps above.

Community
  • 1
  • 1
piotrek1543
  • 19,130
  • 7
  • 81
  • 94
0

Please use complete path of COM package that contain the interface ITelephony.

Example

If you are using

ITelephony telephonyService =(ITelephony) m.invoke(tm);

Then you should use

com.android.internal.telephony.ITelephony telephonyService = (com.android.internal.telephony.ITelephony) m.invoke(tm);