Thursday, March 1, 2012

Why Android 2.3 apps can not access telephone API's or modify call state using MODIFY_PHONE_STATE permission?

I tried to record call as well many others are trying all over the world. Android 2.3 does not allow you to do that as far as i know. I refereed following links:
1. http://prasanta-paul.blogspot.in/2010/09/call-control-in-android.html

2. http://code.google.com/p/auto-answer/source/browse/trunk/src/com/everysoft/autoanswer/AutoAnswerIntentService.java

Above linked seemed to help. Many people told it worked from them in Android 2.1 and Android 2.2 but it does not work with Android 2.3. I got error message: "java.lang.SecurityException: Neither user 10035 nor current process has android.permission.MODIFY_PHONE_STATE." 


To capture call or pickup call programatically you need to use "android.permission.MODIFY_PHONE_STATE" permission in AndroidManifest.xml. From Android 2.3 onwards developers are not allowed to access this permission. Only venders with OEM license can use it for any apps which come preloaded on Android device when you buy it.

Enhancement request for Android 2.3 is already submitted by many developers as many are already using MODIFY_PHONE_STATE permission and without that permission their applications will be useless. Android guys have replied saying this permission was never supposed to be used by developers.

Visit above links for more information. If you are targeting Android 2.1 and Android 2.2 then those links might still help. If you found any new information regarding it then please comment below.

3 comments:

  1. Modify_Phone_State is not working on andrroid 2.2 or later. and how get permission of OEM license.

    ReplyDelete
  2. Same problem for me also if any one get the answer please let me know

    ReplyDelete
    Replies
    1. you have to simply click on project and clean that projec

      Delete

Example code to connect node.js REST service with Eureka discovery service

Eureka is Spring based discovery service developed by Netflix. To know how Eureka is used at Netflix visit: https://github.com/Netflix/e...